### Color me this....

Posted:

**Sat Jan 08, 2005 3:55 pm**
by **Guest**

Does anyone know what calculation would work to select lighter or darker shades of a color, when working with RGB?

Example:

Say my starting color is: 100,55,90

How do I calculate a lighter or darker shade of the above color, still using RGB?

Thanks.

Posted:

**Sat Jan 08, 2005 4:31 pm**
by **Guest**

niot sure if you mean "dynamically scripting it in neobook" or just how to easily check lighter/darker tones of an existing color...

try

http://www.bjfelix.de/magic/suck.php3?delphi=1 for the second possibility. it works great.

translation from german:

"dunkler"=darker

"heller"=lighter

Posted:

**Sat Jan 08, 2005 5:12 pm**
by **Guest**

Troy,

Since 255,255,255 is white and 0,0,0 is black, the higher of every value lightens and vice versa. You can just multiply each number by the same multiple to lighten and divide (or multiply by fraction) by the same multiple to darken.

If you start with 100,55,90 then 200,110,180 would lighten and maintain the same ratio of Red, Green, Blue. 50,28,45 would darken and maintain a close ratio (off by rounding .5)