by superman » Oct 22, 2002 @ 4:27am
To make a color darker, decrease each value by the same value until it reaches zero.
ex.
red (in rgb format)
255, 0, 0
to make a slightly darker red, subtract 25 from each value unless that value is 0, and if the value is < 25, set it to zero.
result: a slightly darker red
230, 0, 0
Now an example with R, G, and B values:
light gray:
192, 192, 192
reduced by 64 on each value yields dark gray
128, 128, 128
By subtracting the same number from each color value, you effectively lower the luminance of the color. To make the color lighter, simply add the same number to each of the R, G, and B values.
"Kittens give Morbo gas." - Morbo the News Monster