Colors are displayed combining RED, GREEN, and BLUE light.
HTML Colors
Colors in HTML can be specified by the following methods:- Hexadecimal colors
- RGB colors
- Color names
Hexadecimal Colors
Hexadecimal color values are supported in all major browsers.A hexadecimal color is specified with: #RRGGBB, where the RR (red), GG (green) and BB (blue) hexadecimal integers specify the components of the color. All values must be between 00 and FF.
For example, the #0000FF value is rendered as blue, because the blue component is set to its highest value (FF) and the others are set to the lowest value (00).
RGB Colors
RGB color values are supported in all major browsers.An RGB color value is specified with: rgb(red, green, blue). Each parameter (red, green, and blue) defines the intensity of the color and can be an integer between 0 and 255.
For example, the rgb(0,0,255) value is rendered as blue, because the blue parameter is set to its highest value (255) and the others are set to 0.
Example
Color
Color HEX
Color RGB
Color Name
#FF0000
rgb(255,0,0)
Red
#00FF00
rgb(0,255,0)
Green
#0000FF
rgb(0,0,255)
Blue
No comments:
Post a Comment