CSS
comment 0

CSS Color Introduction

The discussion on CSS colors might sound like a trivial subject however that’s actually far from the truth. Six Revisions author Jacob Gube has written a detailed explanation on different methods to declare CSS colors which are:

  1. Hexadecimal notation – Hex color code start with hash (#) and followed with 3 characters or six characters of number, alphabet, or combination of number and alphabet.
  2. RGB – RGB stands for Red, Green, Blue. Minimum decimal value is 0 and maximum decimal value is 255. 
  3. RGBA – Similar to RGB. The additional “A” (alpha) is for specifying the level of transparency of your color. Value of alpha can be set between 0 to 1.
  4. HSL – Stands for Hue, Saturation and Lightness. The HSL color notation is an alternative to the RGB color notation. It was introduced to CSS with the idea that it’s more intuitive to learn compared to the RGB color system.
  5. HSLA – Like in RGBA, the A represents the alpha value for transparency.
  6. Color keywords – Basic color names like blue, maroon, black and white. In CSS3, the number of keywords were extended to include fancy color names like royalblue and khaki.

Hit button below to read the detailed explanation.

View More

Filed under: CSS

About the Author

Posted by

Sani Halid is a front-end developer at Stampede and is committed to clean and elegant code. Yet another gamer to join the pack, Sani is also the Editor at Constructs where he shares his daily CSS findings and other front-end development goods.

Leave a Reply