News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: gbc color conversion...  (Read 3980 times)

Kafke

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
gbc color conversion...
« on: January 25, 2011, 07:26:52 pm »
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

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: gbc color conversion...
« Reply #1 on: January 25, 2011, 07:44:14 pm »
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

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Re: gbc color conversion...
« Reply #2 on: January 25, 2011, 07:53:14 pm »
Alright. Thanks.