Qbasicnews.com

Full Version: color -> HEX
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
make a program that displays a color pallet(16 bit) and gives the hex value for selected colors.
Quote:make a program that displays a color pallet(16 bit) and gives the hex value for selected colors.

So it displays a pallette and you can select one or more colors which then gives its hex value. Would be nice to change the palette too..

Sounds easy but boring.. :|
Quote:Sounds easy but boring.. :|

i cnat figuer it out
Quote:
Agamemnus Wrote:Sounds easy but boring.. :|

i cnat figuer it out

[offtopic] I'm sorry, but I'd just like to let everyone know that I have saved this post....... just so I can look at it whenever I want.[/offtopic]

-----------------------

I'm not sure if you can find the HEX of it, unless the hex and the RGB value is the same thing...
Rockuman,
The color value for the palette is R + 256 * G + 256^2 * B. To get the hex value, you can use HEX$. One way would be
Code:
HexVal$ = "&H" + HEX$((256& * B + G) * 256 + R)   ' Notice the first 256 is a long
This isn't meant answer Diroga challenge, just Rockuman's question.
In general about challenges, please challenge other users to a subject you know about. I mean, this topic could've been placed in 'Programming Help' with the title '24-Bit colours?' as well. If you have a question about something, post it in the Help Fora Wink
yeah i thought of that after i posted it. so move thread plz or delete this one