CSS color property


In this, we learn about all the css color property using to design a web page.

 

color names

 Colors can be specified by using color name like- red, green, orange, blue, white, black, yellow and many more.

css color name

RGB color values

An RGB value can specify a color by using this formula - rgb(red, green, blue)

For example

rgb color values

HEX color values

We can also specified color using a hexadecimal value in the form - #rrggbb

hex color values

 

For example

hex xolor values

HSL color values

Using hue, saturation, and lightness (HSL) we can specify a color in the form- hsl(hue, saturation, lightness)

 

For example

hsl color values

Saturation


For example

saturation

Lightness

How much light you want to give the color are describe in lightness of color, where no light (black) is equal to 0%, 50% light (neither dark nor light) is equal to 50%, full lightness (white) is equal to 100%.


For example

lightness

Note :- Hue change the color if brightness and lightness are maintained ( if brightness and lightness are not too much low or too high)

 

HSLA Color Values

An HSLA color value is specified in the form - hsla(hue, saturation, lightness, alpha)

 

For example

hsla color values