Midnight Black

Export

Code

/* Midnight Black — colorset.net */
:root {
  --color-1: #0D1117;
  --color-2: #161B22;
  --color-3: #21262D;
  --color-4: #30363D;
  --color-5: #484F58;

  --color-bg: #F4F7FA;
  --color-surface: #EBEEF1;
  --color-border: #D0D5DC;
  --color-text: #0D1117;
  --color-muted: #62676F;
  --color-primary: #484F58;
  --color-on-primary: #FFFFFF;
  --color-accent: #21262D;
  --color-on-accent: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0D1117;
    --color-surface: #171B22;
    --color-border: #2A3039;
    --color-text: #9FA7B1;
    --color-muted: #7E858F;
    --color-primary: #616872;
    --color-on-primary: #FFFFFF;
    --color-accent: #949AA3;
    --color-on-accent: #0D1117;
  }
}

Color values

ColorHEXRGBHSLOKLCH
1
2
3
4
5

Roles & contrast

Original colors are kept; roles are adjusted only when needed for contrast.

RoleLight modeDark mode
Backgroundadjusted for contrast · from #484F58from palette · color 1
Surfacederivedderived
Borderderivedderived
Textfrom palette · color 1adjusted for contrast · from #484F58
Muted textderivedderived
Primaryfrom palette · color 5adjusted for contrast · from #484F58
On primaryderivedderived
Accentfrom palette · color 3adjusted for contrast · from #484F58
On accentderivedderived

Contrast

Light mode
PairSampleRatioWCAG
Text on background17.60:1AAA pass 4.5:1
Text on surface16.25:1AAA pass 4.5:1
Muted text on background5.29:1AA pass 4.5:1
Label on primary8.28:1AAA pass 4.5:1
Label on accent15.22:1AAA pass 4.5:1
Primary on background7.71:1AAA pass 3:1
Accent on background14.16:1AAA pass 3:1
Dark mode
PairSampleRatioWCAG
Text on background7.78:1AAA pass 4.5:1
Text on surface7.10:1AAA pass 4.5:1
Muted text on background5.08:1AA pass 4.5:1
Label on primary5.63:1AA pass 4.5:1
Label on accent6.68:1AA pass 4.5:1
Primary on background3.36:1AA Large pass 3:1
Accent on background6.68:1AA pass 3:1

Every color on every color

Rows are backgrounds and columns are text colors, using the actual palette colors. Ratios: AAA 7:1, AA 4.5:1, AA large text 3:1.

Every color on every color
Background / Text#0D1117 (Text 1)#161B22 (Text 2)#21262D (Text 3)#30363D (Text 4)#484F58 (Text 5)
#0D1117Same color1.09—1.24—1.55—2.28—
#161B221.09—Same color1.14—1.42—2.09—
#21262D1.24—1.14—Same color1.25—1.84—
#30363D1.55—1.42—1.25—Same color1.47—
#484F582.28—2.09—1.84—1.47—Same color

How to read contrast ratios (WCAG guide)

Shades

Shades and tints (50–950)

#0D1117#161B22#21262D#30363D#484F58

Variations

About Midnight Black

Nearly all of the color weight in Midnight Black sits in neutral, which makes it a balanced palette anchored by charcoal #21262D. There is no real hue here; neutrals between #0D1117 and #484F58 do all the work with value contrast. All five colors stay in a narrow dark band (18% to 42% lightness, #0D1117 to #484F58), so text and background roles are adjusted for contrast. Saturation is very low (mean OKLCH chroma 0.015, peaking at 0.017 in #484F58); the palette is close to grayscale. Text contrast reaches 17.6:1 in light mode and 7.8:1 in dark mode, with #484F58 as primary and #21262D as accent. Try it for documentation sites, architecture studios and minimal branding, letting slate #484F58 carry the key actions.

Midnight Black color palette: #0D1117, #161B22, #21262D, #30363D, #484F58
Share image for Midnight Black

Gradients in similar colors