0xrrggbb
, where rr
is the red, gg
the green, and bb
the blue component of the color.
(2*r+5*g+b)/8
, rounded
down to the nearest integer. For 1-bit black and white mode images the color
is converted into black (0) or white (1) using the formula (2*r+5*g+b)/1024
.
Examples of valid colors:
0xffff00
: Bright yellow
0x004000
: Dark green
(255,0,0)
: Bright red
0
: Black
255
: Bright blue
(128,128,128)
: Medium gray
Examples of invalid colors:
Invalid code, do not use!
(0,0.5,0.9)
: Floats are not supported
'#ff80c0'
: The HTML color format is not supported
(-1,0,1000)
: Out-of-range values
(1,2)
: The sequence is too short
[128,128,192]
: This is not a tuple
See About this document... for information on suggesting changes.