Skip to content

#0c024f

a deep, electric blue · cool · closest name: Midnight Blue

RGB
12, 2, 79
HSL
248°, 95%, 16%
CMYK
85, 98, 0, 69
Luminance
0.0069

At a glance

Every number on this page in one read: what #0c024f is made of, how bright it looks, and which way it leans.

Hex
#0c024f
Hue
248°
blue
Saturation
95%
electric
Lightness
16%
deep
Brightness
31%
HSV value
Perceived
11%
weighted brightness
Luminance
0.0069
WCAG relative
Temperature
Cool
79/100 cool
Color family
Blue
Tone
Electric
Best ink
White
18.47:1
Closest name
Midnight Blue
ΔE2000 6.9
Where it sits
Hue248° of 360°
Saturation95%
Lightness16%
Temperature
Warm ← → Cool79% cool

Reads cool. Warm and cool siblings keep the same lightness, so you can swap one in without redoing your contrast maths.

Every format

HEX#0c024f
RGBrgb(12, 2, 79)
HSLhsl(248, 95%, 16%)
CMYKcmyk(85%, 98%, 0%, 69%)
LABlab(6.2 32.0 -43.5)
LCHlch(6.2 54.0 306.4)
OKLCHoklch(0.205 0.127 272.9)
Decimal787023
Display P3color(display-p3 0.047 0.008 0.310)

Copy-ready code

/* CSS */
color: #0c024f;
background-color: #0c024f;
/* Tailwind (arbitrary) */
class="text-[#0c024f] bg-[#0c024f]"
/* SCSS */
$brand: #0c024f;
/* SwiftUI */
Color(red: 0.047, green: 0.008, blue: 0.310)
/* Android */
Color.parseColor("#0c024f")
/* Flutter */
Color(0xFF0C024F)
/* Python / OpenCV (BGR) */
(79, 2, 12)

Best text color

Only one of black and white can be right. This is the one, with the number that proves it.

Readable at a glance#ffffff on #0c024f · 18.47:1
Use #ffffffAAA at every size.
Aa
White text · 18.47:1 · recommended
AA pass · AA large pass · AAA pass
Aa
Black text · 1.14:1
AA fail · AA large fail · AAA fail
Reading the other direction: #0c024f as text scores 18.47:1 on white and 1.14:1 on black.

Accessibility — WCAG contrast

Aa
#0c024f on white: 18.47:1
AA ✓ pass · AA-large · AAA
Aa
#0c024f on black: 1.14:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #001751
deuteranopia · #00104E
tritanopia · #001C2B

Color scale — 50 to 950

A Tailwind-shaped ramp built around this exact hex. #0c024f is pinned to step 950; the rest hold its hue and let saturation ease off at the extremes so the pale end never turns neon.

#F3F1FD
#E7E4FB
#C9C2FA
#9F92FC
#705BFB
#4024FA
#2406EF
#1E05C7
#18049F
#160873
#0c024f
Base = 950Lightest = 50 · #F3F1FDDarkest = 950 · #0c024f
:root {
  --brand-50: #F3F1FD;
  --brand-100: #E7E4FB;
  --brand-200: #C9C2FA;
  --brand-300: #9F92FC;
  --brand-400: #705BFB;
  --brand-500: #4024FA;
  --brand-600: #2406EF;
  --brand-700: #1E05C7;
  --brand-800: #18049F;
  --brand-900: #160873;
  --brand-950: #0c024f;
  --brand: #0c024f;
  --brand-ink: #ffffff;
}

Colors that work with #0c024f

Not a palette — a role sheet. Each swatch answers one question you will hit while building the component.

Text on it#ffffff
White wins here
Surface#F5F4FA
Tinted page background
Border#C6C0ED
Hairlines and dividers
Muted text#554B9B
Captions on the surface
Accent#514700
Second voice, not a rival
Dark variant#13037C
Hover, pressed, headers
Light variant#E9E6FE
Selected rows, tints
Dark surface#161424
Dark-mode background
Light mode
Everything in its place

Surface, border, heading and body all derive from this one hue, so the screen stays coherent without a second palette.

Primary actionSecondaryBadge
Dark mode
Same hue, inverted

Lightness flips, hue holds. The accent stays the anchor in both themes.

Primary actionSecondaryAccent

How to use #0c024f

Derived from its contrast, chroma and lightness — not from taste.

Works well for
  • Body text and links on white
  • Primary buttons and calls to action
  • Focus rings, active and selected states
  • Headers, footers and dark-mode surfaces
  • Brand accents, badges and data highlights
Use with care
  • Text on black or near-black surfaces
  • Full-page backgrounds — tiring over long sessions
  • Black text placed on it
  • Pairing with a same-lightness hue — edges vibrate

Similar colors

One move away from this hex in each direction. Every swatch is its own page.

Color relationships

The wheel positions with their names attached, so you can grab the one you actually need.

Complementary#454F02
Analogous left#021F4F
Analogous right#33024F
Split-complement 1#4F3302
Split-complement 2#1F4F02
Triadic 1#4F0C02
Triadic 2#024F0C
Tetradic#4F021F

RGB percentages

Red4.7%
Green0.8%
Blue31.0%

CMYK percentages

Cyan84.8%
Magenta97.5%
Yellow0.0%
Key (black)69.0%

Color previews

#0c024f text on a black background

contrast 1.14:1

Card sample

#0c024f text on a white background

contrast 18.47:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

color: #0c024f;
Background color
Panel with #0c024f background
background-color: #0c024f;
Text shadow — hex

Glowing headline

text-shadow: 2px 2px 8px #0c024f;
Text shadow — RGB

Soft neon halo

text-shadow: 0 0 14px rgba(12, 2, 79, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(12, 2, 79, 0.45);
Border & gradient
Gradient panel
border: 3px solid #0c024f;
background: linear-gradient(135deg, #0c024f, #3F024F);

Monochromatic scale

Palettes built from #0c024f

Shades — darker

Tints — lighter

Color harmonies

Nearest named colors

Ranked with CIEDE2000 across all 139 CSS keywords. Under ΔE 2 the eye stops telling them apart; over ΔE 10 they are plainly different colors.

#0c024f in the real world

Where a color in this family tends to land, and the interface roles it is usually asked to play.

Industries
TechnologyFinanceHealthcareEnterprise SaaS
Common UI roles
ButtonsLinksFocus statesCharts
Print note

Sits outside most CMYK gamuts — expect a duller press result, or specify a spot ink.

#0c024f, answered

What color is #0c024f?

#0c024f is a deep electric blue, closest to Midnight Blue (ΔE2000 6.9). It sits at 248° on the hue wheel with 95% saturation and 16% lightness, which reads as cool.

What is the RGB value of #0c024f?

rgb(12, 2, 79) — 12 red, 2 green and 79 blue out of 255, or 4.7% / 0.8% / 31% by channel.

Is #0c024f a light or a dark color?

It is a dark color. Relative luminance is 0.0069 and perceived brightness is 11%, so white text on it reaches 18.47:1.

Should I use black or white text on #0c024f?

White. It scores 18.47:1 against #0c024f, versus 1.14:1 for black — AAA at any size.

What is the complementary color of #0c024f?

#454F02 sits directly opposite on the wheel. Softer options are the split-complements #4F3302 and #1F4F02, which give the same contrast with far less vibration.

What colors go well with #0c024f?

For interface work: #F5F4FA as the surface, #C6C0ED for borders, #554B9B for secondary text, #514700 as an accent and #13037C for hover and pressed states. For a palette, the analogous pair #021F4F and #33024F stays calm, while #454F02 is the loudest partner.

What is #0c024f in CMYK for printing?

cmyk(85%, 98%, 0%, 69%). This is a screen-to-ink approximation — a color this saturated sits outside most CMYK gamuts and will print duller than it looks here.

Is #0c024f warm or cool?

Cool — it scores 79 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #28024F; nudged cooler, #011450.

Work with #0c024f in the Color Lab