real rgb values to doubles

Today I wrote a class that takes an image an spits it out as an array of quads with each quad matching the r,g,b,transparency and location date of each pixel of the original. (I’m rather proud of myself to be honest).
But I am stumped at something that I can’t figure out.

I have the original rgb values (0-255) but need to convert them to a double that lwjgl can read. With the color4d its 0-1.

Is anyone aware of what the conversion is?

value / 256.0f

Just divide each one by 255 to get their 0-1 scale. (r/255.0,g/255.0,b/255.0,a/255.0)

Thanks chaps, I knew I was missing something obvious, been a long day! Thank again guys.

Erm yes 255. :slight_smile:

I assumed thats what you ment, the colors look a little odd. But it works, thanks again