PDA

View Full Version : Is my computer color blind?



waldoo
03-06-2002, 11:17 AM
I made a program to select color and converted RGB into HEX for color palette in real time. The color result on color palette showed different than a color I selected on OpenGL window.

I wasn't sure what was wrong with it. So I tested my painter program from vendor. I zoomed the picture and selected a color. I still get the same result. Is my computer color blind?

Color palette is 16bit, the texture map is 16 bit, screen color mode os 16 bit. Everything is 16 bit. Except that I know nothing about OpenGL window and its internal color bit.

Waldoo

jefftkd
03-06-2002, 12:13 PM
Someone please correct me if I am wrong, but I vaguely remember reading something where OpenGL colors were not stored the same as regular 32-bit colors.

I know you said your colors are 16-bit, but maybe this is related.

Typically I remember HEX colors stored as 0xAARRGGBB, but OpenGL stores as 0xRRGGBBAA (or vice versa). Try checking the color you are getting to see if it matches this kind of pattern.

And if I am totally wrong here, someone please correct me http://www.opengl.org/discussion_boards/ubb/smile.gif

Jeff

zeckensack
03-06-2002, 12:43 PM
I'm not sure either whether I understood the question ...

If you want to specify colors in OpenGL you use either float components ranging from 0.0f to 1.0f (eg glColor3f(1.0f,0.5f,0.0f);) or byte components ranging from 0 to 255 (eg glColor3b(255,128,0);). That's regardless of the actual color depth. The story's different when you're in color index mode but in all honesty, nobody should do that anymore.

If you're trying to get pixel colors back from OpenGL, the story's a little different of course.