More
More
#040B2E colour
#040B2E is a very dark blue close to CSS midnightblue. RGB 4, 11, 46, HSL 230, 84%, 10%. White text passes AAA (19.22:1), black fails (1.09:1).
- Nearest CSS name
midnightblue#191970 (not an exact match)- Described as
- a very dark blue
- Red, green, blue
- 4, 11, 46
- Web safe
- No
- Luminance
- 0.0046 (WCAG relative luminance, 0 is black, 1 is white)
Colour codes
| HEX | #040b2e | |
|---|---|---|
| RGB | rgb(4, 11, 46) | |
| RGB (percent) | rgb(1.6% 4.3% 18%) | |
| HSL | hsl(230, 84%, 9.8%) | |
| HSV / HSB | hsv(230, 91.3%, 18%) | |
| HWB | hwb(230 1.6% 82%) | |
| CMYK (naive) | cmyk(91%, 76%, 0%, 82%) | |
| CIELAB (D50) | lab(3.91% 6.29 -23.41) | |
| OKLCH | oklch(17.13% 0.0711 267.36) | |
| Decimal | 265006 |
CMYK here is the plain formula with no colour profile, so treat it as a starting point; a printer's profile gives the real ink values. CIELAB uses a D50 white point, as CSS lab() does. HSV is not a CSS function, so it is shown for design apps only.
Contrast with white and black text
| Text | Ratio | AA normal (4.5) | AA large (3) | AAA normal (7) | AAA large (4.5) |
|---|---|---|---|---|---|
| White | 19.22:1 | Pass | Pass | Pass | Pass |
| Black | 1.09:1 | Fail | Fail | Fail | Fail |
White text is the better choice on #040B2E (19.22:1). Ratios use the WCAG 2.2 formula; large text means at least 24px, or 18.66px bold. Check another pair.
Tints and shades
Mixed with white, then with black, in ten even steps (straight sRGB mixing, as most design tools do).
Colour harmonies
Hue turned around the HSL colour wheel, saturation and lightness kept.
How it looks with colour blindness
Simulated with the Machado, Oliveira and Fernandes (2009) matrices at full severity, applied in linear RGB; achromatopsia shows the colour's luminance as grey. Milder forms (protanomaly, deuteranomaly) are far more common and shift colours less. Never use colour as the only way to carry meaning.
CSS
| Text colour | color: #040b2e; | |
|---|---|---|
| Background | background-color: #040b2e; | |
| Border | border: 1px solid #040b2e; | |
| Half transparent | background-color: rgb(4 11 46 / 50%); | |
| Custom property | --colour-main: #040b2e; | |
| Gradient to a darker shade | background: linear-gradient(135deg, #040b2e, #02071c); | |
| Gradient from a lighter tint | background: linear-gradient(180deg, #686d82, #040b2e); | |
| Text on this colour | background-color: #040b2e; color: #fff; |
Similar named colours
midnightblue#191970, distance 13.8navy#000080, distance 15.4darkblue#00008b, distance 17.3black#000000, distance 18.5indigo#4b0082, distance 21darkslategray#2f4f4f, distance 24.2#2e2704Complement of #040B2E
Distance is measured in OKLab, scaled by 100; under about 2 is hard to tell apart side by side.
Convert #040B2E to other formats · Build a palette from it · Check contrast · All named colours
Colour names from CSS Color Module Level 4. Palette values from the Tailwind CSS v3 default palette (MIT licence) and the Material Design 2014 colour palette as published in Material Design Lite (Apache License 2.0). All other values are calculated from the hex code.