|
Posted by jasen on 01/13/07 03:48
On 2007-01-12, Onideus Mad Hatter <usenet@backwater-productions.net> wrote:
> On 12 Jan 2007 02:26:05 -0800, sl@f0r7r355.org wrote:
> ...wow...even Wikipedia FAILS to explain it with anything other than
> the most simplistic glazing jive of redundant incoherency. Tsch,
> tsch, tsch...a simple formula/equation is just TOO MUCH to ask
> apparently. Oh how the mighty web has fallen.
>
Binary RGB:
RGB colours are represented in the low 24 bits of a 32-bit number
8bits for red
8bits for green
8bits for blue
to convert 8-bit unsigned (0..255) R,G, and B values to an RGB value
you need to shift the red 16 bits and the green 8 bits to the left
this means multiplying red by 65536 and green by 256 and then adding
them all up.
one easy way to do this is to write them in hex.
--
Bye.
Jasen
Navigation:
[Reply to this message]
|