

Used in a dark room, turning on only the red flashlight ( #ff0000) will make everything appear to be red. In hex, 00 means “off”, and ff means “flashlight full on”. the default color of your screen).Ī simple mnemonic to remember base-16 for color is to think of each color component (red, green and blue) as a seperate flashlight with an appropriate filter on it. Note that CSS hexadecimal color is an additive color system where no input means black (i.e.

So #000000 would represent black - no input from red, green or blue - while white would be #ffffff, and #ffff00 yellow. The complete hexadecimal color is preceeded by a # symbol. The higher the value for a component, the more “strength” or “input” it has in the final color - 00 represents no input of a color component, and ff represents a total commitment of a component. At that point, the last digit starts ticking upwards again. At that point, the first digit rolls over like an odometer, and the last one resets, becoming 10. After 09, the number pair moves to 0a, then 0b, until it gets to 0f. One step higher would be 01, followed by 02, etc. Used in pairs this way, the lowest value of a color component would be 00.

In the most common variant, hex color components - red, green and blue - are represented by two pairs of digits each. Unlike our familiar base-10 system, with integers from 0 to 9, the hexadecimal system has 16 digits: 0 to 9, followed by a to f. The key to learning hex is understanding the hexadecimal counting system. Standard CSS color keywords are limited to 149 named shades the hexadecimal (or “hex”) color method has access to the full RGB gamut.
