Re: Please explain colors

new topic     » goto parent     » topic index » view thread      » older message » newer message

Tony Steward wrote:
> Hello everybody,
> In the likes of IDE if you specify the color red it equals 255.
> A particular shade of blue is 8388608.
> 
> Please explain this numbering system to me.
> 
> How do I explain in my documents to an end user how to get the number 
> corrisponding to the color they would like to use.
> 
> I have an ini file the end user can edit with the following lines in it.
> 
> [snip]
>   GridColorBackground = 16777215
>   GridColorText = 0
>   GridColorBackgroundSelect = 12615680
>   GridColorTextSelect = 16777215
>   GridColorInKeys = 32768
>   GridColorLostDamKeys = 128
>   GridColorOutKeys = 8388608
> [/snip]

A color is encoded as an RGB-value: 3 bytes that represent the red-,
green- and blue-value of the color. 0 = no intensity, 255 = full intensity.
They are encoded like this: BBBBBBBB GGGGGGG RRRRRRR (each letter represents
 a bit), or hexadecimal: #BBGGRR.
The color red is 255, or #FF, which equals #0000FF: 0 blue, 0 green, 255 red.

Here are some of the basic colors:
 - #000000 = black (0% color)
 - #FFFFFF = white (100% color)
 - #0000FF = red (0% blue, 0% green, 100% red)
 - #00FF00 = green (0% blue, 100% green, 0% red)
 - #FF0000 = blue (100% blue, 0% green, 0% red)
 - #00FFFF = yellow (0% blue, 100% green, 100% red)
 - #FF00FF = magenta (100% blue, 0% green, 100% red)
 - #FFFF00 = cyan (100% blue, 100% green, 0% red)

If all 3 bytes are the same, you have a gray color:
#000000, #010101, #020202, ..., #FEFEFE, #FFFFFF = black - gray - white

You can make a color darker by decreasing the values and lighter by
increasing the values.

--
The Internet combines the excitement of typing 
with the reliability of anonymous hearsay.

tommy online: http://users.telenet.be/tommycarlier
tommy.blog: http://tommycarlier.blogspot.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu