HTML Colors

HTML Colors
To make your webpage more attractive and beautiful HTML provides you a range of different colors. HTML colors are specified with predefined color names, or with RGB, HEX, HSL, RGBA, or HSLA values.
You can specify colors on page level using <body> tag or you can set colors for individual tags using bgcolor attribute.
The <body> has following attributes to use colors:
• bgcolor-sets a color for the background of the page.
• text- sets a color for the body text.
• alink-sets a color for active links or selected links.
• link-sets a color for linked text.
• vlink-sets a color for visited links , i.e., for linked text that you have already clicked on.

Color Name
In HTML, colours can be specified using color name. There are around 140 standard color names supported by HTML.
For example,

pink

dodgerblue

slateblue

orange


HEX Color Codes
HEX color code is a six-digit code representing the amount of red, green, and blue that makes up the color.this three byte hexadecimal numbers (i.e., consist of six digits), with each byte, or pair of characters in the Hex code, representing the intensity of red, green and blue in the color respectively.
Hex code byte values range from 00, which is the lowest intensity of a color, to FF which represents the highest intensity. The color white.
for example,

#007bff

is made by mixing each of the three primary colors at their full intensity, resulting in the Hex color code of #FFFFFF.
Black, the absence of any color on a screen display, is the complete opposite, with each color displayed at their lowest possible intensity with a Hex color code of #000000 .

#000000

The three primary colors, red, green and blue, are made by mixing the highest intensity of the desired color with the lowest intensities of the other two.

#ff0000

#00ff00

#0000ff

RGB Values
This property takes three integer values between 0 to 255, one each, for red, green and blue.Each parameter (red, green, and blue) defines the intensity of the color.
This implies that there are 256 x 256 x 256 = 16777216 possible colors...

rgb(255, 0, 0)

rgb(0, 0, 255)

rgb(0, 255, 0)

rgb(199, 365, 200)

rgb(146, 190, 105)

rgb(248, 30, 38)