← All gradients
35%How it works
UI

Midnight Blue UI

#020617
#0F172A
#1E293B
Text readability
Ui DarkNeutral

Midnight Blue UI is a dark and neutral 3-colour linear gradient that runs from near-black (#020617) through near-black (#0F172A) to charcoal (#1E293B) at 135°. It suits dark-mode interfaces and footers and subtle surfaces and app backgrounds. White text reads best on it, at a contrast ratio of 17.8:1 against the gradient’s average colour (AAA). Check every point, not just the average →

CSS
background: linear-gradient(135deg, #020617, #0F172A, #1E293B);
Tailwind
bg-gradient-to-br from-[#020617] via-[#0F172A] to-[#1E293B]
Figma token
{
    "midnight-blue-ui": {
        "value": "linear-gradient(135deg, #020617 0%, #0F172A 50%, #1E293B 100%)",
        "type": "color"
    }
}

Midnight Blue UI gradient for SwiftUI, Flutter, Android and more

The same gradient, same direction, ready for your app or design system.

let midnightBlueUiGradient = LinearGradient(
    colors: [
        Color(red: 0.008, green: 0.024, blue: 0.09),
        Color(red: 0.059, green: 0.09, blue: 0.165),
        Color(red: 0.118, green: 0.161, blue: 0.231)
    ],
    startPoint: UnitPoint(x: 0, y: 0),
    endPoint: UnitPoint(x: 1, y: 1)
)

// Usage
Rectangle().fill(midnightBlueUiGradient)

Colours in the Midnight Blue UI gradient

StopNameHEXRGBHSL
1Near-black#020617rgb(2, 6, 23)hsl(229, 84%, 5%)
2Near-black#0F172Argb(15, 23, 42)hsl(222, 47%, 11%)
3Charcoal#1E293Brgb(30, 41, 59)hsl(217, 33%, 17%)

Midnight Blue UI gradient in use

Build something beautifulA hero section on the Midnight Blue UI gradientGet started
Button
Card accentAs a border or progress bar
Gradient text

Midnight Blue UI gradient variations

Reversed
Horizontal
Radial
Conic
Softer
Deeper
Smooth (OKLCH)
Hard stops

Download as an image

Free PNG wallpapers and backgrounds, drawn in your browser at full resolution.

Frequently asked questions

What are the hex codes for the Midnight Blue UI gradient?

The Midnight Blue UI gradient uses 3 colours: #020617, #0F172A and #1E293B, at an angle of 135°.

How do I use the Midnight Blue UI gradient in CSS?

Paste background: linear-gradient(135deg, #020617, #0F172A, #1E293B); into any element’s styles. For Tailwind, use the class list in the Tailwind block above.

What text colour works on the Midnight Blue UI gradient?

White text has the best contrast, at 17.8:1 against the gradient’s average colour, which is AAA. Check the lightest and darkest ends too if text spans the whole gradient.