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
- 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
9 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.
Onyx color values
| RGB | 31 | 33 | 36 | |
|---|---|---|---|---|
| HSL | 216° | 7% | 13% | |
| HSV | 216° | 14% | 14% | |
| CMYK | 0.14 | 0.08 | 0.00 | 0.86 |
| XYZ | 1.4273 | 1.5064 | 1.8843 | |
| Yxy | 1.5064 | 0.2962 | 0.3127 | |
| CIE-Lab | 12.6485 | -0.1286 | -2.3379 | |
| Hunter Lab | 12.2735 | -0.7205 | -0.5111 | |
| OKLCH | 24.7% | 0.006 | 258.4° |
#1F2124 is 31 red, 33 green and 36 blue. No single channel dominates it. The nearest of the 216 web safe colors is #333333.
CIE-Lab, XYZ and Yxy are measured against D65, the white point sRGB itself is defined against. Hunter Lab uses the original illuminant C constants, which is what paint and plastics specifications quote, so the two Lab rows are not directly comparable. CMYK is the plain arithmetic conversion: real ink values depend on the press, the paper and the profile.
| Base | Red | Green | Blue |
|---|---|---|---|
| Binary | 00011111 | 00100001 | 00100100 |
| Octal | 37 | 41 | 44 |
| Decimal | 31 | 33 | 36 |
| Hex | 1F | 21 | 24 |
#1f2124 mixed with black
Ten even steps of the classic shade ramp, worked out in RGB, which is how the term has always been defined and how other references list it. The OKLCH scale further down this page answers a different question: it steps by equal perceived amounts, so its values are not the same.
- #1F2124
- #1B1D20
- #181A1C
- #151719
- #121315
- #0F1012
- #0C0D0E
- #09090A
- #060607
- #030303
- #000000
#1f2124 mixed with white
The tint ramp, by the same rule in the other direction.
- #1F2124
- #353739
- #4B4D4F
- #626365
- #78797B
- #8F9091
- #A5A6A7
- #BBBCBD
- #D2D2D3
- #E8E8E9
- #FFFFFF
Channel shares
Color schemes
Turned in OKLCH rather than HSL, so every member keeps the lightness and chroma of the original instead of one of them arriving washed out.
Complementary
- #1F2124
- #23211E
Triadic
- #1F2124
- #242020
- #1F221F
Analogous
- #1F2124
- #212024
- #1E2223
Monochromatic
- #000101
- #000101
- #060709
- #1F2124
- #3D3F42
- #5D6063
- #808286
#1f2124 on black and on white
The quick brown fox jumps over the lazy dog. 1.30:1
The quick brown fox jumps over the lazy dog. 16.14:1
Body text needs 4.5:1 to meet AA and large text needs 3:1, so a ratio tells you which of the two backgrounds this color can be read on, and at what size.
CSS for #1f2124
color: #1f2124;
background-color: #1f2124;
border: 3px solid #1f2124;
box-shadow: 1px 1px 3px 2px #1f2124;
text-shadow: 4px 4px 2px rgba(31, 33, 36, 0.8);
/* Perceptually even, and what a modern stylesheet wants */
color: oklch(24.7% 0.006 258.4);The OKLCH form is the same color stated so that lightening or darkening it moves by an amount the eye agrees with. Every current browser understands 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.
No onyx palettes yet
Run npm run generate to build the dataset.