Skip to content

#040bdf

a dark, electric blue · cool · closest name: Medium Blue

RGB
4, 11, 223
HSL
238°, 97%, 45%
CMYK
98, 95, 0, 13
Luminance
0.0559

At a glance

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

Hex
#040bdf
Hue
238°
blue
Saturation
97%
electric
Lightness
45%
dark
Brightness
87%
HSV value
Perceived
30%
weighted brightness
Luminance
0.0559
WCAG relative
Temperature
Cool
84/100 cool
Color family
Blue
Tone
Electric
Best ink
White
9.91:1
Closest name
Medium Blue
ΔE2000 2.7
Where it sits
Hue238° of 360°
Saturation97%
Lightness45%
Temperature
Warm ← → Cool84% 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#040bdf
RGBrgb(4, 11, 223)
HSLhsl(238, 97%, 45%)
CMYKcmyk(98%, 95%, 0%, 13%)
LABlab(28.4 69.6 -96.3)
LCHlch(28.4 118.8 305.9)
OKLCHoklch(0.413 0.280 264.5)
Decimal265183
Display P3color(display-p3 0.016 0.043 0.875)

Copy-ready code

/* CSS */
color: #040bdf;
background-color: #040bdf;
/* Tailwind (arbitrary) */
class="text-[#040bdf] bg-[#040bdf]"
/* SCSS */
$brand: #040bdf;
/* SwiftUI */
Color(red: 0.016, green: 0.043, blue: 0.875)
/* Android */
Color.parseColor("#040bdf")
/* Flutter */
Color(0xFF040BDF)
/* Python / OpenCV (BGR) */
(223, 11, 4)

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 #040bdf · 9.91:1
Use #ffffffAAA at every size.
Aa
White text · 9.91:1 · recommended
AA pass · AA large pass · AAA pass
Aa
Black text · 2.12:1
AA fail · AA large fail · AAA fail
Reading the other direction: #040bdf as text scores 9.91:1 on white and 2.12:1 on black.

Accessibility — WCAG contrast

Aa
#040bdf on white: 9.91:1
AA ✓ pass · AA-large · AAA
Aa
#040bdf on black: 2.12:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #004EE4
deuteranopia · #0037DC
tritanopia · #005E83

Color scale — 50 to 950

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

#F1F2FD
#E4E4FC
#C1C3FB
#9194FD
#5A5FFC
#2329FB
#040bdf
#040AC8
#0308A0
#070A74
#040648
Base = 600Lightest = 50 · #F1F2FDDarkest = 950 · #040648
:root {
  --brand-50: #F1F2FD;
  --brand-100: #E4E4FC;
  --brand-200: #C1C3FB;
  --brand-300: #9194FD;
  --brand-400: #5A5FFC;
  --brand-500: #2329FB;
  --brand-600: #040bdf;
  --brand-700: #040AC8;
  --brand-800: #0308A0;
  --brand-900: #070A74;
  --brand-950: #040648;
  --brand: #040bdf;
  --brand-ink: #ffffff;
}

Colors that work with #040bdf

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#F4F4FA
Tinted page background
Border#C0C1ED
Hairlines and dividers
Muted text#4B4D9B
Captions on the surface
Accent#CC9300
Second voice, not a rival
Dark variant#02067D
Hover, pressed, headers
Light variant#E6E7FF
Selected rows, tints
Dark surface#141424
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 #040bdf

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#DFD804
Analogous left#0478DF
Analogous right#6B04DF
Split-complement 1#DF6B04
Split-complement 2#78DF04
Triadic 1#DF040B
Triadic 2#0BDF04
Tetradic#DF0478

RGB percentages

Red1.6%
Green4.3%
Blue87.5%

CMYK percentages

Cyan98.2%
Magenta95.1%
Yellow0.0%
Key (black)12.5%

Color previews

#040bdf text on a black background

contrast 2.12:1

Card sample

#040bdf text on a white background

contrast 9.91:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

color: #040bdf;
Background color
Panel with #040bdf background
background-color: #040bdf;
Text shadow — hex

Glowing headline

text-shadow: 2px 2px 8px #040bdf;
Text shadow — RGB

Soft neon halo

text-shadow: 0 0 14px rgba(4, 11, 223, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(4, 11, 223, 0.45);
Border & gradient
Gradient panel
border: 3px solid #040bdf;
background: linear-gradient(135deg, #040bdf, #8F04DF);

Monochromatic scale

Palettes built from #040bdf

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.

#040bdf 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.

#040bdf, answered

What color is #040bdf?

#040bdf is a dark electric blue, closest to Medium Blue (ΔE2000 2.7). It sits at 238° on the hue wheel with 97% saturation and 45% lightness, which reads as cool.

What is the RGB value of #040bdf?

rgb(4, 11, 223) — 4 red, 11 green and 223 blue out of 255, or 1.6% / 4.3% / 87.5% by channel.

Is #040bdf a light or a dark color?

It is a dark color. Relative luminance is 0.0559 and perceived brightness is 30%, so white text on it reaches 9.91:1.

Should I use black or white text on #040bdf?

White. It scores 9.91:1 against #040bdf, versus 2.12:1 for black — AAA at any size.

What is the complementary color of #040bdf?

#DFD804 sits directly opposite on the wheel. Softer options are the split-complements #DF6B04 and #78DF04, which give the same contrast with far less vibration.

What colors go well with #040bdf?

For interface work: #F4F4FA as the surface, #C0C1ED for borders, #4B4D9B for secondary text, #CC9300 as an accent and #02067D for hover and pressed states. For a palette, the analogous pair #0478DF and #6B04DF stays calm, while #DFD804 is the loudest partner.

What is #040bdf in CMYK for printing?

cmyk(98%, 95%, 0%, 13%). 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 #040bdf warm or cool?

Cool — it scores 84 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #4D04DF; nudged cooler, #0237E1.

Work with #040bdf in the Color Lab