Color values in CSS are used to specify colors to HTML elements. Generally this property is used to specify color of the text.
Defining CSS color
CSS provides us various methods by which we can define color values.
The three main methods to define colors in CSS are:
One of the ways to define color in CSS is RGB value.color value can be specified using rgb() property.
rgb() property is defined by setting three numerical values separated by commas in this property. Each define value for red,green and blue.
Another way to define color in CSS is HEX value.color in HEX() is defined using the hexadecimal value.
Color is defined as #rrggbb() where rr represent color red,gg represent color green and bb represent color blue.
It is also a way to define color in CSS.color value can be specified using hsl() property.
hsl() property is defined by setting three values separated by commas in this property.
In hsl() property hue defines color. Its degree on color wheel 0 is red,120 is green and 240 is blue. Saturation is a shade of grey in percentage value 0% means grey shade 100% means full color. lightness is also a percentage value where 0% is black,50% is nothing and 100% is white.