Moonlight Color Palette
#0D1321 · #1D3461 · #4472C4 · #A8C0E8
Use #0D1321 as the background. Use #1D3461 as the primary accent. Use #4472C4 as secondary. Use #A8C0E8 as body text/supporting color. Palette mood: Moonlight — night, cool, calm.
Hex Codes, RGB & CMYK Color Values
Technical breakdown for the Moonlight color scheme. Use these values for web design (HEX/RGB), print projects (CMYK), or specialized design software (HSL).
| Swatch | Design Role | HEX | RGB | CMYK | HSL |
|---|---|---|---|---|---|
| Background Luminance: 0.7% | 13, 19, 33 | 61%, 42%, 0%, 87% | 222°, 43%, 9% | ||
| Decorative / accent Luminance: 3.6% | 29, 52, 97 | 70%, 46%, 0%, 62% | 220°, 54%, 25% | ||
| Large text / UI Luminance: 17.2% | 68, 114, 196 | 65%, 42%, 0%, 23% | 218°, 52%, 52% | ||
| Text · AAA Luminance: 51.9% | 168, 192, 232 | 28%, 17%, 0%, 9% | 218°, 58%, 78% |
Moonlight Tints & Shades
Hover states, borders and elevation need lighter and darker steps of your base colors. Here are computed tints and shades for every color in the Moonlight palette — click any swatch to copy its hex.
Moonlight Palette Contrast Matrix (WCAG 2.1)
Every color tested as text on every other color as background. Body copy needs 4.5:1 (AA), large text and UI components 3:1. AAA requires 7:1.
| Text on Background | Preview | Ratio | Grade | Safe For |
|---|---|---|---|---|
| #A8C0E8 on #0D1321 |
Aa Sample Text
| 10.04:1 | AAA | Body text, headings, UI |
| #0D1321 on #A8C0E8 |
Aa Sample Text
| 10.04:1 | AAA | Body text, headings, UI |
| #A8C0E8 on #1D3461 |
Aa Sample Text
| 6.62:1 | AA | Body text, UI |
| #1D3461 on #A8C0E8 |
Aa Sample Text
| 6.62:1 | AA | Body text, UI |
| #4472C4 on #0D1321 |
Aa Sample Text
| 3.93:1 | Fail | Large headings, UI components |
| #0D1321 on #4472C4 |
Aa Sample Text
| 3.93:1 | Fail | Large headings, UI components |
| #4472C4 on #1D3461 |
Aa Sample Text
| 2.59:1 | Fail | Decorative use only |
| #1D3461 on #4472C4 |
Aa Sample Text
| 2.59:1 | Fail | Decorative use only |
| #A8C0E8 on #4472C4 |
Aa Sample Text
| 2.55:1 | Fail | Decorative use only |
| #4472C4 on #A8C0E8 |
Aa Sample Text
| 2.55:1 | Fail | Decorative use only |
| #1D3461 on #0D1321 |
Aa Sample Text
| 1.51:1 | Fail | Decorative use only |
| #0D1321 on #1D3461 |
Aa Sample Text
| 1.51:1 | Fail | Decorative use only |
Color Harmony: Monochromatic
4 of 4 colors sit at essentially the same hue (220°, blue); the palette varies them by lightness and saturation rather than hue.
Single-hue palettes are the easiest to keep consistent, but neighbouring slots can look flat — separate them with lightness steps of at least 15%.
History & Design Context
Best Design Use Cases
Measured best pair: #A8C0E8 on #0D1321 at 10.04:1 (AAA). Use this pair for paragraph copy; the surface roles above are not body-text prescriptions.
Deep navy with periwinkle light
#A8C0E8 is the moonlight in this palette, reading at 10.04:1 on the deepest navy #0D1321. #1D3461 is the raised surface at 6.62:1 against the periwinkle, and #4472C4 is the royal blue for interactive elements.
The palette suggests night without becoming black. Keep the periwinkle for text and icons, use the royal blue for actions, and avoid putting body copy on the mid navy where the step to the text colour is smaller.
Industries This Palette Suits
Colors That Pair Well With Moonlight
Need a fifth color? These three companions are computed from the palette's own hue positions on the color wheel, so they extend the scheme without breaking its harmony.
directly opposite #1D3461 on the wheel — the strongest accent for CTAs and highlights when you need maximum energy
30° beside #1D3461 — a calm secondary that extends the palette without adding tension
a paper-white carrying the palette's own hue — perfect for surfaces and dividers
Using Moonlight Without Breaking Accessibility
- Avoid #1D3461 for small UI elements on #0D1321 — at 1.51:1 it misses the 3:1 WCAG threshold; darken it with a shade from the ramp below.
- Set body text in #A8C0E8 — 10.04:1 against #0D1321 passes WCAG AA (AAA) for long-form reading.
- Let #4472C4 carry sidebars, cards and footers — at a mid lightness it separates zones without stealing focus from #1D3461.
How to Implement the Moonlight Color Scheme
To use this Moonlight color palette in your web project, copy the CSS variables below or open the export panel for Tailwind, SCSS and Figma formats.
Option 1: CSS Variables
:root {
/* Moonlight — ihatecolors */
--color-bg: #0D1321;
--color-accent: #1D3461;
--color-secondary: #4472C4;
--color-text: #A8C0E8;
} Web Design Tip
#1D3461 on #0D1321 measures 1.51:1 — below the 3:1 WCAG threshold for UI components. Use it for decoration only, or darken it with a shade from the ramp before using it for buttons, icons or borders.
Accessibility Note
Body copy in #A8C0E8 on #0D1321 measures 10.04:1, which passes WCAG AAA for normal text.
Moonlight Palette — Frequently Asked Questions
What are the hex codes in the Moonlight color palette?
The Moonlight palette contains #0D1321, #1D3461, #4472C4, #A8C0E8. Click any swatch on this page to copy its value, or export all four at once as CSS variables, Tailwind config, SCSS or a Figma-ready list.
Is the Moonlight color palette accessible (WCAG)?
Yes. #A8C0E8 on #0D1321 reaches 10.04:1, which passes WCAG AAA for normal text (7:1) as well as AA and the 3:1 UI threshold — use it for body copy and controls. The full contrast matrix above shows the exact score for every color-on-color pair in this palette.
What colors go well with the Moonlight palette?
Beyond its own four colors, #896929, #2D245C, #EBECEF extend it naturally: the complementary hue for high-energy accents, an analogous neighbor for calm transitions, and a tinted neutral for surfaces. All three are computed from this palette's hues on the color wheel.
What mood does the Moonlight palette create?
Moonlight reads as night, cool, calm. Gently saturated blue drives the personality, grounded by gently saturated blue — a combination that works best when the deep base gets most of the canvas.
Can I use the Moonlight color palette commercially?
Yes. Individual color values can't be copyrighted, so the Moonlight palette is free for personal, client and commercial work — websites, branding, apps, print and social content, with no attribution required.
How do I add the Moonlight palette to Tailwind or CSS?
Use the export panel on this page: CSS variables, a Tailwind config block, SCSS variables, or a Figma copy list are generated from Moonlight's exact values, including the tint and shade ramps shown above.