News:

11 March 2016 - Forum Rules

Main Menu

gbc color conversion...

Started by Kafke, January 25, 2011, 07:26:52 PM

Previous topic - Next topic

Kafke

It's probably a stupid question, but I can't seem to figure it out for the life of me. You know the colors under VBA's "palette viewer"?

Well, I can't figure out how to convert the color from the  hex value to rgb.
How does it go about converting it?


Don't just say: "Just look at the r, g, and b that vba gives you" because I want to know how it converts, not what it converts into.

Ryusui

It doesn't convert anything. It just takes the individual bit values and strings 'em together in 555 BGR order.

The 16-bit palette value decodes as XBBBBBGGGGGRRRRR (where X is meaningless).

Say we have a color that's Red 24, Green 3, Blue 0. 24 is 11000, 3 is 00011, and 0 is 00000 (obviously). That comes out to 0000000001111000, or 0078.
In the event of a firestorm, the salad bar will remain open.

Kafke