Onyx color: hex codes, shades and palettes

Palettes built around onyx. Click any swatch to copy its hex code.

A near-black with the faintest cool cast. Useful as a background where pure black is too harsh but charcoal is too light.

Onyx hex, RGB, HSL and OKLCH

#1F2124
HEX
#1F2124
RGB
rgb(31, 33, 36)
HSL
hsl(216, 7%, 13%)
OKLCH
oklch(24.7% 0.006 258.4)
On white
16.14:1
On black
1.30:1

Shades of onyx

Eleven steps from one base color, generated in OKLCH so each step is an equal perceived step rather than an equal numeric one. Click a swatch to copy it.

Contrast and readability

Onyx on white measures 16.14:1 and on black 1.30:1. WCAG AA asks for 4.5:1 on normal text and 3:1 on large text and UI components, so the higher of those two decides which background it belongs on. In the scale above, 500 is the first to clear 4.5:1 on white, at 5.27:1.

The contrast checker reports every level for a given pair and suggests the nearest passing shade on the same hue. The color picker builds this same scale from any color you paste in.

Related colors:black. See every shade on the colors index.