On this page
Use the studio above to change stops, angle and type, then copy the CSS. Below I cover the exact color codes, how navy differs from midnight and dark blue, contrast ratios I calculated, fixes for banding, and where these gradients work in print and interiors as well as on screens.
What Counts as a Dark Blue Gradient?
A dark blue gradient is any transition where every stop stays low in lightness and the hue sits in the blue range, roughly 210 to 245 degrees on the HSL wheel. Our three anchors fit that: has 10% lightness, has 27% and has 45%. Together they give a clear dark-to-bright ramp that still reads as one color family.
Dark blue has long been a default for finance, software and legal brands, so a gradient in it feels familiar and steady. The gradient adds depth and a sense of light without needing a photo or an illustration. That makes it a reliable background for headlines, product shots and app screens.
Dark Blue Color Codes: HEX, RGB, HSL and CMYK
Here are the three anchor colors with every format you are likely to need, plus the contrast ratio of white text on each.
| Name | HEX | RGB | HSL | CMYK | White text |
|---|---|---|---|---|---|
| Midnight Blue | 10, 17, 40 | 226, 60%, 10% | 75, 58, 0, 84 | 18.7:1 | |
| Dark Blue | 0, 0, 139 | 240, 100%, 27% | 100, 100, 0, 45 | 15.3:1 | |
| Blue | 30, 86, 200 | 220, 74%, 45% | 85, 57, 0, 22 | 6.5:1 |
The CMYK numbers are straight mathematical conversions from RGB. A real press profile will shift them, and I come back to that in the print section. HSL is the most useful format for tweaking: keep the hue between 220 and 240 and a darker or lighter step stays recognizably navy, while a hue below about 210 starts drifting toward steel or teal.
Dark Blue vs Navy vs Midnight Blue
CSS has three named colors in this territory. darkblue is , navy is and midnightblue is . The first two are almost the same color, since their blue channels differ by only 11 levels. Midnightblue is softer because its saturation is lower (64% against 100%), which gives it a slightly dusty, inky feel.
Our start color is not a CSS keyword. It is a near-black with a blue cast, and it is what keeps a gradient from looking like a flat primary blue. Pure has zero red and zero green, so it can look electric and slightly violet on bright screens. If you want that blue calmer, mix in grey or move toward a blue grey gradient.
Copy-Ready CSS for Dark Blue Gradients
Every snippet below starts with a solid fallback color, which browsers use if the gradient fails to load. Angles follow the CSS convention: 90deg runs left to right, 180deg runs top to bottom, and 135deg runs diagonally from the top left.
Linear: the everyday default
.hero {
background: #0A1128;
background: linear-gradient(135deg, #0A1128 0%, #00008B 55%, #1E56C8 100%);
}
The 55% stop pushes the saturated middle slightly past the halfway point, so the dark corner gets more room. Moving it to 40% brightens the whole surface. Diagonal angles tend to feel natural because they imitate light falling from one corner.
Radial: a glow behind content
.glow {
background: radial-gradient(circle at 70% 20%, #1E56C8 0%, #00008B 35%, #0A1128 75%);
}
A radial version puts the brightest blue where you want attention, such as behind a product image or a sign-up form. Keep the glow off-center and the layout feels less like a spotlight and more like ambient light.
Fixing Banding and Muddy Midtones
Dark gradients band because there are fewer distinct 8-bit levels in dark colors, and the eye is sensitive to small steps there. On a fintech dashboard I built for a client, the hero looked clean on my calibrated screen and striped on theirs. Adding a faint tiling noise image over the gradient fixed it, because grain breaks up the hard edges between steps.
Your dark blue hero shows visible stripes on a client's monitor. What is the quickest fix?
Grain breaks up the hard edges between 8-bit color steps, so the eye reads a smooth blend.
Two more habits help. Give long gradients a wider lightness range, since a nearly flat blend stretched over 2000 pixels bands the worst. In modern browsers you can also write linear-gradient(in oklab 135deg, #0A1128, #00008B, #1E56C8) for smoother perceptual blending, with a plain sRGB line above it for older browsers. Muddy midtones are a different problem: blending dark blue straight into orange or yellow passes through grey-brown, so add a middle stop that keeps some saturation.
Try this: Open your gradient on a phone at low brightness and squint. If you can see stripes, lay a grain image over it at low opacity and compare the two versions side by side.
Text Contrast on Dark Blue Gradients
WCAG AA asks for at least 4.5:1 for normal text and 3:1 for large text (24px, or 18.66px if bold). I calculated white text against each stop of the main gradient from the standard relative luminance formula:
- White on : 18.7:1
- White on : 15.3:1
- White on : 6.5:1
- White on the soft glow stop : 3.7:1, large text only
Because every channel rises steadily from to , the lightest point decides whether text passes. Black text on reaches only about 3.2:1, so on this gradient, keep body text light.
Which text color is the safe choice over the bright end of the gradient, #1E56C8?
White reaches about 6.5:1 on #1E56C8, while black only reaches about 3.2:1.
On one marketing site the headline sat over the brightest corner and quietly failed AA. My fix was to flip the angle so the darkest stop sat behind the text, which cost nothing visually. If your design needs a brighter stop like , reserve it for decoration and keep paragraphs on the darker side.

Colors That Pair Well with Dark Blue
Dark blue is easy to pair because it gives strong contrast to almost anything light or warm. These combinations are the ones I reach for most:
- Gold such as for a premium, finance or invitation feel
- Soft blue-grey such as for text, borders and icons
- Coral or orange for buttons and highlights
- Teal such as for a calm, close-neighbor effect
Warm accents are the strongest move, since orange sits opposite blue on the color wheel. The orange to blue gradient page shows how to blend the two without a grey middle. For a cooler, more tonal look, move toward a teal gradient.

Navy with red and white is the classic patriotic mix. The red and blue palette page covers the combinations, and Memorial Day colors shows them in seasonal use.
Let dark blue carry most of the surface and give the accent one job, like a button or a thin highlight line.
Dark Blue Gradients for Web, Apps and Dark Mode
Dark blue gradients suit hero sections, login screens, pricing cards and app backgrounds. In dark mode, a base like often feels softer than pure black while still saving glare. If you want a neutral version, the black gradient page covers dark theme options.
Keep the gradient on the background and let content surfaces stay flat, so text sits on a predictable color. Focus rings and borders need at least 3:1 against the color around them under WCAG 1.4.11. Storing your stops as variables keeps a whole interface consistent:
:root {
--navy-900: #0A1128;
--navy-700: #00008B;
--navy-500: #1E56C8;
}
.card {
background: linear-gradient(160deg, var(--navy-900), var(--navy-700));
}
For secondary panels, a gray gradient can sit next to navy without competing with it.
Print, Branding, Interiors and Fashion
Print is where dark blue surprises people. I once proofed a business card in for a client, and under office lighting it came back almost black. We lifted the base to and the navy finally showed. Dark blues with a lot of black ink lose their hue, so always ask for a physical proof and treat the CMYK in the table as a starting point.
Beyond screens, the same blend works as an ombre feature wall, where midnight at the ceiling fades to a lighter blue near the floor. In fashion it appears as dip-dye fabric and faded denim. For art, it is a natural base for night skies and watercolor washes. In branding, keep one flat navy version of the logo background for small sizes, since gradients can turn muddy in favicons and app icons.
Dark Blue Palettes You Can Copy
Each palette below starts from the same near-black navy and adds a different accent. Midnight Studio stays within the blues, Navy and Gold adds warmth, Deep Sea leans teal, and Dusk Violet moves toward purple.
Dashboards, SaaS hero sections and product pages with white text.
Finance, law and invitation designs that need a quiet, premium feel.
Wellness apps, ocean themes and calm landing pages with a cool accent.
Music, gaming and event graphics that want a twilight mood.
Pick one, use the darkest swatch for backgrounds, and pair it with the lightest swatch for text. Then use the studio above to tune the angle until the bright corner sits away from your headline.
The colors behind these gradients
Dark Blue Gradient: questions people ask
What is the hex code for dark blue?
The CSS keyword darkblue is #00008B, which is rgb(0, 0, 139). For a deeper, near-black navy that works better as a gradient start, use #0A1128.
How do I make a dark blue gradient in CSS?
Use linear-gradient with an angle and two or three stops, for example linear-gradient(135deg, #0A1128, #00008B, #1E56C8). Add a plain background-color line before it as a fallback.
What colors go well with a dark blue gradient?
Warm golds, copper and coral stand out strongly against dark blue, and teal gives a calm, close-neighbor look. Soft blue-greys like #C9D6F2 work well for text and borders.
Is white text readable on a dark blue gradient?
Yes. White measures 18.7:1 on #0A1128, 15.3:1 on #00008B and 6.5:1 on #1E56C8, all above the WCAG AA minimum of 4.5:1 for normal text.
Why does my dark blue gradient look striped?
Dark colors have fewer distinct 8-bit levels, so the steps between them become visible as bands. A subtle noise overlay or a wider lightness range between stops usually hides them.
Keep exploring
- Brown Gradient: Dark Brown Gradient Colors, Hex Codes and CSS
- Pastel Green Gradient: Backgrounds, Wallpapers and CSS Codes
- Rainbow Gradient: Colors, Backgrounds and CSS Codes
- Green Gradient: Color Combinations, Hex Codes and CSS
- Bronze Gradient: Wallpaper Colors, Hex Codes and CSS
- Blue Gradient: Colors, Hex Codes and CSS Backgrounds
- Honey Blonde Color: Hex Code, RGB and Palettes
- Light Green Color: Hex Code, RGB and Palettes