[SOLVED] How Does the 11.x RGBA Work?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
sphyrth
Party member
Posts: 260
Joined: Mon Jul 07, 2014 11:04 am
Contact:

[SOLVED] How Does the 11.x RGBA Work?

Post by sphyrth »

Alright, I've ignored this for a long time, but this 0 to 1 rgb-range is throwing me off... and I apologize that this is literally asking to be spoonfed.

Can someone put out Love2D's new equivalent rgba for this (it's Gold, btw)?

Code: Select all

love.graphics.setColor(255, 215, 0, 1)
Thanks in advance.
Last edited by sphyrth on Mon Jun 24, 2019 12:23 pm, edited 1 time in total.
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: How Does the 11.x RGBA Work?

Post by zorg »

new = old / 255
0/255 = 0
255/255 = 1
Simple math, and it approximates it almost perfectly.
So, if i can divide right with the google machine, 215/255 is about 0.843... then again, you can just write 215/255 as well.
Not sure why you're mixing the old and new ranges though, since your alpha of one in the old system means almost transparent...
you probably want (1,0.843,0,1)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 211 guests