Color Codes

Take-home Message

Hexadecimaal codes are 6-8 character-long alphanumeric codes used to specify colors and should be used when available.

Before selecting colors, we should be able to name them. Screens make use of RGB color space, where Red, Green, and Blue make up the three primary colors.1 Regardless of software, a six-digit hexadecimal code will serve as a consistent color naming convention. Hexadecimal (i.e. “16”) is a base-16 counting system, as described in Figure fig-hexCodes.

  • 1 This is distinct from CMYK color space (Cyan, Magenta, Yellow and Key (Black)), which is subtractive and used in print. It’s also different than what you may have expected given what you know from mixing paints: Red, Yellow, Blue define the primary triad in the RYB color space.

  • Figure 1: The hexidecimal code for colors. Base-10 counting is shown for comparison. A hexidecimal code is made up of three two-digit base-16 numbers.

    Together the combination of these three values provides almost \(16.8\) million colors (\(256^2 = 16,777,216\)). Now that we have an easy convention to refer to color, let’s think about how to select them appropriately.