ways to color in css

by jshacker

HTML

<div>Ways to color. See JS comment.</div>

CSS

div {
  color: #b22;
  font-size: 32px;
  border-bottom: thick solid rgba(220, 20, 20, 0.1);
  text-align: center;
  padding: 10px;
}

JavaScript

/*
  color values:
  1. hex
      #rrggbb
        rr, gg, bb: 00 - FF
      #rgb
        r, g, b: 0 - F
  2. rgb rgb(red, green, blue)
      r, g, b: 0 - 255
  3. hsl
  4. hsv
  5. rgba rgba(red, green, blue, alpha)
      r, g, b: 0 - 255
      alpha: 0 - 1 
  6. name e.g. red green blue magenta maroon lime navy
*/

/* hex:
	 0 1 2 3 4 5 6 7 8 9  10  11  12  13  14  15  16 - decimal
   0 1 2 3 4 5 6 7 8 9   a   b   c   d   e   f  10 - hexadecimal
 *  
 */