|
An RGB color specifies the intensity of the Red, Green and Blue
components of a color. Imagine it as a set of three overlapping
colored lights. Any color can be created using a combination of
these lights.
We specify the intensity as a percentage. 0% indicates that the
light is off, 100% that it is fully on. So:
- If you want a bright red you should have the red light on and
the green and blue off (color = 100,0,0).
- If you want a blue you should have the blue on and the others
off (color = 0,0,100).
- If you want black you should have all off (color = 0,0,0)
- If you want white you should have all on
(color=100,100,100).
Some graphics packages specify color intensities as decimal
numbers between 0 and 255 or as hexadecimal numbers between 00 and
FF. You can use both these methods. For decimal numbers you must
preceed the number by 0d and for hexadecimal by 0x. So:
- If you want a bright red you could specify 0d255,0d0,0d0
- If you want a bright blue you could specify 0x00,0x00,0xFF
- If you want black you could specify 0x00,0x00,0x00
- If you want cyan you could specify 0d00,0d255,0d255
When working with HTML you may want to specify a color using an
RGB Hex Code as used in HTML. So:
- If you want a bright red you could specify #FF0000
- If you want a bright blue you could specify #0000FF
- If you want black you could specify #000000
- If you want cyan you could specify #00FFFF
|
|
|