PDA

View Full Version : Colours



link19
06-01-2001, 09:13 AM
Hey,
Im using glColor3d with RGB values in decimal (i.e. from 0->255). I dont get complaints, but not all my colours show up. It seems only the 0 and 255 are recognized as parameters...otherzise the colour shows up white. Whats the deal?

Deiussum
06-01-2001, 10:14 AM
If you're using glColor3d, you should be using values between 0 and 1. Values get clamped to this range so depending on what exactly you send, you probably won't get what you expect. If your colors are in the range 0-255 you should divide them by 255 to get the correct values for glColor3d.

link19
06-01-2001, 11:25 AM
thx. Didnt know to divide by 255...

zed
06-01-2001, 04:14 PM
d stands for double 1.0 - 1.0
if u wanna use values between 0-255 use ub (unsigned byte)