HTML Colors

Let it be any display; computer or TV – All colors appears with the combination of Red, Blue and Green light.

When it comes to HTML and CSS, all colors have different names. Let us have a look over them.

Color Names

Red
Yellow
Orange
Cyan
Blue

 

Please Note:  CSS Support 140 standard different colors.

 

What is RGB (Red, Green Blue)?

Using a correct RGB (Red, Green, Blue) formula, HTML code can be executed.

The intensity of each parameter (red, green, blue) can be defined between the range of 0 and 255.

Example
rgb (0,255,0)
This formula will execute only green color as green color's intensity has been set to the highest i.e., 255 whereas rest have been set to 0.
Output
Green

 

Example

RGB                                COLOR
rgb(255, 0, 0)                  Red
rgb(0,255,0)                    Green
rgb(0,0,255)                    Blue
rgb(255,255,0)                Orange
rgb(0,255,255)                Cyan

 

However, different shades of gray are defined using equal values of rgb.

Example

RGB                               COLOR
rgb (0,0,0)                      WHITE
rgb (128,128,128)           GRAY
rgb (255,255,255)           BLACK

 

Hexadecimal Colors

Using HTML, RGB values can also be defined using hexadecimal form i.e., #RRGGBB. Here, RR is red, GG is green and BB is blue. And, its hexadecimal values ranges between 00 and FF just like decimal range of 0 and 255.

Syntax

#00FF00

Output

 

Usage of RGB colors with Hexadecimal format:

HEX                              COLOR
#FF0000                       RED
#00FF00                      GREEN
#0000FF                      BLUE
#FFFF00                      ORANGE
#00FFFF                      CYAN

However, different shades of gray are defined using equal values of rgb.

Example

RGB                            COLOR
#000000                     WHITE
#808080                     GRAY
#FFFFFF                      BLACK

 

email