Home·Colour name reference

#331166

#331166

Purples · #316 is the three-digit shorthand for #331166. In CSS the two notations mean the same color.

HEX#331166
RGB51, 17, 102
HSL264°, 71%, 23%
CMYK50%, 83%, 0%, 60%
Relative luminance0.02

Tap a code to copy it

Text contrast

Aa

On white

14.86:1 Passes AA

Aa

On black

1.41:1 Below AA

Colours that work with it

Complement

#436411

Analogous

#111964#5C1164

Triadic

#643211#116432

Shade scale

50100200300400500600700800

Seen with colour blindness

ProtanopiaDeuteranopiaTritanopia

How to read this

  • A hex code writes red, green and blue as two hexadecimal digits each. #ff0000 is red at full strength and the others at zero.
  • HSL states hue (0–360°), saturation and lightness. Nudging a colour brighter means changing one number, which is why it is easier to work with by hand.
  • Text contrast follows WCAG. Body-size text needs 4.5:1 or better, and 21:1 between white and black is the maximum possible.
  • The colour-blindness row computes how this colour appears under three types of colour vision deficiency — the reason never to encode information in colour alone.

Frequently asked questions

Q. Are #316 and #331166 the same color?

Yes. CSS doubles each digit of a three-digit hex, so #316 expands to #331166. Only 4,096 colors can be written in three digits, and this is one of them.

Q. What text color works on #331166?

White text. Contrast against white is 14.86:1 and against black 1.41:1, so pick the larger one — WCAG asks for 4.5:1 at body size.

Q. Which named color is closest to #331166?

Midnight blue. It is not an exact match, so where color matters use the hex code itself rather than the name.

Closest named colors