#202151 Midnight

rgb(32, 33, 81)

Color conversions

HEX
#202151
RGB
rgb(32, 33, 81)
RGBA
rgba(32, 33, 81, 1)
HSL
hsl(239, 43%, 22%)
HSV / HSB
hsv(239, 60%, 32%)
CMYK
cmyk(60%, 59%, 0%, 68%)

Wide-gamut spaces

XYZ
xyz(2.624, 1.989, 8.029)
LAB
lab(15.43 15.66 -29.68)
LCH
lch(15.43 33.56 297.81)
OKLAB
oklab(27.71% 0.0124 -0.0849)
OKLCH
oklch(27.71% 0.0858 278.31)
Nearest name
Midnight

Shades, tints and tones

Shades

Tints

Tones

Color harmonies

Complementary

The hue directly opposite on the color wheel. Maximum contrast, ideal for a single accent against a dominant brand color.

Analogous

Neighbouring hues that share a temperature. The safest harmony for calm, cohesive interfaces.

Triadic

Three hues evenly spaced 120 degrees apart. Vibrant and balanced — use one as dominant and the other two sparingly.

Split Complementary

The complement split into two adjacent hues. Nearly the contrast of complementary with noticeably less tension.

Square (Tetradic)

Four hues at 90-degree intervals. A rich set for illustration, data visualisation, and category coding.

Rectangle (Tetradic)

Two complementary pairs offset by 60 degrees. Gives two warm and two cool options in one system.

Monochromatic

A single hue across five lightness levels. The foundation of most UI scales and the most accessible starting point.

Similar colors

Closest matches

Opacity variations

#2021511a

#20215133

#2021514d

#20215166

#20215180

#20215199

#202151b3

#202151cc

#202151e6

#202151ff

Accessibility and contrast

On white

15.02:1

Body text AAA · Large text AA

On black

1.4:1

Body text Fail · Large text Fail

White-on-color contrast is 15.02:1.

Color blindness preview

Protanopia

No red cones — ~1% of men

Protanomaly

Reduced red sensitivity — ~1% of men

Deuteranopia

No green cones — ~1% of men

Deuteranomaly

Reduced green sensitivity — ~5% of men

Tritanopia

No blue cones — very rare

Tritanomaly

Reduced blue sensitivity — very rare

Achromatopsia

No color perception — ~1 in 30,000

Achromatomaly

Partial color perception — rare

Meaning, psychology and brand usage

The default of trust — and of everything else

Blue lowers perceived risk and is consistently rated as the most trustworthy hue, which is exactly why it saturates finance, enterprise software, and social platforms. Its ubiquity is now its weakness: a blue primary is safe but rarely memorable.

Trust, stability, and competence in Western markets; immortality in parts of East Asia; and protection against the evil eye across the Mediterranean and Middle East.

Ultramarine was ground from lapis lazuli and once cost more than gold, which is why medieval painters reserved it for the Virgin's robes. Synthetic ultramarine in 1826 democratised it almost overnight.

Reliable as a primary in any category that must feel secure. Differentiate by pushing toward an unusual chroma or pairing with an unexpected accent rather than defaulting to blue-plus-gray.

Common industries: Finance, Enterprise software, Insurance, Government, Aviation. Pairs well with warm amber for energy, crisp white for clarity, rose for a contemporary contrast.

Code exports

CSS

:root {
  --color-midnight: #202151;
  --color-midnight-rgb: 32 33 81;
  --color-midnight-hsl: 239 43% 22%;
  --color-midnight-oklch: 27.71% 0.0858 278.31;
}

.element {
  color: #202151;
  background-color: hsl(239, 43%, 22%);
  border: 1px solid rgb(32 33 81 / 40%);
}

SCSS

$midnight: #202151;
$midnight-light: #9090a8;
$midnight-dark: #101129;

.element {
  color: $midnight;
  background: rgba($midnight, 0.12);

  &:hover {
    color: darken($midnight, 8%);
  }
}

LESS

@midnight: #202151;
@midnight-light: lighten(@midnight, 12%);
@midnight-dark: darken(@midnight, 12%);

.element {
  color: @midnight;
  background: fade(@midnight, 12%);
}

Tailwind CSS

/* Tailwind v4 — src/styles.css */
@theme {
  --color-midnight-50: #d2d3dc;
  --color-midnight-100: #bcbccb;
  --color-midnight-200: #a6a6b9;
  --color-midnight-300: #797a97;
  --color-midnight-400: #4d4d74;
  --color-midnight-500: #202151;
  --color-midnight-600: #1d1e49;
  --color-midnight-700: #161739;
  --color-midnight-800: #101129;
  --color-midnight-900: #0a0a18;
}

/* Usage */
<div class="bg-midnight-500 text-midnight-50 ring-midnight-600" />

/* Arbitrary value, no config needed */
<div class="bg-[#202151]" />

Bootstrap

// Bootstrap 5 — _variables.scss (before importing bootstrap)
$midnight: #202151;
$primary: $midnight;

$theme-colors: map-merge($theme-colors, (
  "midnight": $midnight
));

// Generates .text-midnight, .bg-midnight, .btn-midnight
@import "bootstrap/scss/bootstrap";

Flutter

import 'package:flutter/material.dart';

const Color midnight = Color(0xFF202151);

// As a MaterialColor swatch
const MaterialColor midnightSwatch = MaterialColor(0xFF202151, <int, Color>{
  50: Color(0xFFD2D3DC),
  100: Color(0xFFBCBCCB),
  200: Color(0xFFA6A6B9),
  300: Color(0xFF797A97),
  400: Color(0xFF4D4D74),
  500: Color(0xFF202151),
  600: Color(0xFF1D1E49),
  700: Color(0xFF161739),
  800: Color(0xFF101129),
  900: Color(0xFF0A0A18),
});

Swift / SwiftUI

import SwiftUI

extension Color {
    /// #202151 — Midnight
    static let midnight = Color(
        red: 0.1255,
        green: 0.1294,
        blue: 0.3176
    )
}

// UIKit
extension UIColor {
    static let midnight = UIColor(
        red: 0.1255,
        green: 0.1294,
        blue: 0.3176,
        alpha: 1.0
    )
}

Android

<!-- res/values/colors.xml -->
<resources>
    <color name="midnight">#202151</color>
    <color name="midnight_translucent">#80202151</color>
</resources>

<!-- Jetpack Compose -->
val Midnight = Color(0xFF202151)

JavaScript

export const MIDNIGHT = {
  hex: "#202151",
  rgb: [32, 33, 81],
  hsl: [239, 43, 22],
  oklch: "oklch(27.71% 0.0858 278.31)",
};

JSON tokens

{
  "$schema": "https://design-tokens.org/schema.json",
  "midnight": {
    "$type": "color",
    "$value": "#202151",
    "$description": "Midnight — generated by ColorVerse AI"
  }
}