CSS Colors
Colors in CSS can be specified using its predefined color names, or RGB, HEX, HSL,
RGBA, HSLA values. The predefined color names are simply the name of the colors that we know.
RGB Value – colors can also be specified using the RGB values. The formula is rgb(red, green, blue). The parameter – red, green and blue has values from 0 to 255 which defines the intensity of the color. For example, rgb(0,0,255) is displayed as blue since blue is set to the value 255 while others are set to 0.

RGBA Value – this is an extension of the RGB color values. A stands for alpha channel is used to specify the opacity for a color. The value of A ranges from 0.0 (fully transparent) and 1.0 (not transparent at all).

HEX Value – The color value can also be specified using a hexadecimal value with the form #RRGGBB. RR, GG and BB stands for red, green and blue respectively. It is expressed in hexadecimal values from 00 to ff. For example, a color red has the value #ff0000 where red (RR) is set to the maximum value ff while the rest are 00.

HSL Value – color can be specified using hue, saturation, and lightness (HSL). The formula
for this is hsl(hue, saturation, lightness). Hue value is from 0 to 360 which is the
degree on the color wheel. Saturation and lightness are in percentage. For saturation, 0% means a
shade of gray while 100% is the full color. In lightness, 0% is black, and 100% is white.