colors
Back to gallery

Midnight Anil

#271d54
Notes

Midnight Anil (#271D54) is a deep indigo with an earthy character. It leans grounded and natural, the kind of color that plays well with wood, clay, linen, and warm neutrals. Its HSL profile (251°, 49%, 22%) places it in the balanced band at a dark lightness. It works well as a headline, icon, or deep background in an otherwise light layout, pairing cleanly with cream, bone, and warm neutrals. For a confident two-color system, pair it with its complementary yellow. For something softer, pull in its analogous neighbors on either side of the wheel.

HEX
#271d54
RGB
rgb(39, 29, 84)
HSL
hsl(251, 49%, 22%)
HWB
hwb(251 11% 67%)
OKLCH
oklch(27.8% 0.096 286.8)
P3
color(display-p3 0.1467 0.1152 0.3170)
HSV
hsv(251, 65%, 33%)
LAB
lab(15.22% 21.22 -32.01)
LCH
lch(15.22% 38.41 303.54)
CMYK
cmyk(54%, 65%, 0%, 67%)

Etymology

Midnight
noun

The color of the sky at midnight on a clear, moonless night, far from city lights — almost black, but with a slight blue cast where star-scattered light reaches the eye. The color refers to that exact moment: a very deep, slightly violet-shifted near-black blue with the optical depth of a sky stripped of every direct light source. Deeper than navy, warmer than ink, with the temporal weight of a name that is a precise hour as well as a color.

Anil
noun

Portuguese and Spanish for Indigofera tinctoria — derived via the Arabic al-nīl from the Sanskrit nīla (dark blue), the colonial-era European name for indigo before indigo itself supplanted it in the 18th century. Anil color refers to a freshly anil-dyed Portuguese azulejo-period linen: a saturated, slightly cool deep blue-violet with the matte finish of multi-bath fermentation indigo on hand-spun linen.

Closest matches

The nearest named color in three reference sources, ranked by perceptual distance (ΔE76 in CIELAB). ΔE < 1 is imperceptible to most viewers; ΔE > 10 is clearly different. When two sources point to the same hex they’re merged into one tile; click any to open that color’s page.

Variations

Click any swatch to explore

Harmonies

Accessibility

Color-vision simulation

How this color appears to viewers with the four major color-vision-deficiency types. Computed via the Machado (2009) physiologically-based model. If a tile matches the original, the color reads the same to that viewer.

#271d54
Original
#002856
Protanopia
#002553
Deuteranopia
#172a35
Tritanopia
#232323
Achromatopsia
WCAG contrast

The color used as foreground text against pure white and pure black, with the contrast ratio and WCAG 2.1 grade. Aim for AA (4.5:1) for body text and AA Large (3:1) for 18 pt+ headlines; AAA (7:1) is the gold standard for long-form reading surfaces.

The quick brown foxSample body text at normal size. The wcag minimum for body contrast is 4.5:1 (AA) or 7:1 (AAA).
AAAon White
15.11:1
The quick brown foxSample body text at normal size. The wcag minimum for body contrast is 4.5:1 (AA) or 7:1 (AAA).
Failon Black
1.39:1

Wide gamut

Display P3 representation

The CSS Color 4 wide-gamut form of this color. Both swatches render the same color on every display — the P3 form only diverges from sRGB when a designer pushes channels outside sRGB's reach.

sRGB hex
sRGB hex
##271D54
Display P3
Display P3
color(display-p3 0.1467 0.1152 0.3170)
P3 has subtle headroomOKLCH chroma 0.096

Moderately saturated colors gain a small bump in P3 — the difference is usually visible side-by-side on wide-gamut hardware but won't change the character of the color.

Related Colors

Canvas