Skip to content

#040fdb

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

RGB
4, 15, 219
HSL
237°, 96%, 44%
CMYK
98, 93, 0, 14
Luminance
0.0548

At a glance

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

Hex
#040fdb
Hue
237°
blue
Saturation
96%
electric
Lightness
44%
dark
Brightness
86%
HSV value
Perceived
29%
weighted brightness
Luminance
0.0548
WCAG relative
Temperature
Cool
85/100 cool
Color family
Blue
Tone
Electric
Best ink
White
10.02:1
Closest name
Medium Blue
ΔE2000 2.5
Where it sits
Hue237° of 360°
Saturation96%
Lightness44%
Temperature
Warm ← → Cool85% 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#040fdb
RGBrgb(4, 15, 219)
HSLhsl(237, 96%, 44%)
CMYKcmyk(98%, 93%, 0%, 14%)
LABlab(28.1 67.7 -94.5)
LCHlch(28.1 116.2 305.6)
OKLCHoklch(0.410 0.274 264.5)
Decimal266203
Display P3color(display-p3 0.016 0.059 0.859)

Copy-ready code

/* CSS */
color: #040fdb;
background-color: #040fdb;
/* Tailwind (arbitrary) */
class="text-[#040fdb] bg-[#040fdb]"
/* SCSS */
$brand: #040fdb;
/* SwiftUI */
Color(red: 0.016, green: 0.059, blue: 0.859)
/* Android */
Color.parseColor("#040fdb")
/* Flutter */
Color(0xFF040FDB)
/* Python / OpenCV (BGR) */
(219, 15, 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 #040fdb · 10.02:1
Use #ffffffAAA at every size.
Aa
White text · 10.02:1 · recommended
AA pass · AA large pass · AAA pass
Aa
Black text · 2.10:1
AA fail · AA large fail · AAA fail
Reading the other direction: #040fdb as text scores 10.02:1 on white and 2.10:1 on black.

Accessibility — WCAG contrast

Aa
#040fdb on white: 10.02:1
AA ✓ pass · AA-large · AAA
Aa
#040fdb on black: 2.10:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #004DE0
deuteranopia · #0036D8
tritanopia · #005D81

Color scale — 50 to 950

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

#F1F2FD
#E4E5FC
#C1C4FA
#9196FD
#5A62FC
#232EFB
#0411F0
#040fdb
#030BA0
#070D73
#040848
Base = 700Lightest = 50 · #F1F2FDDarkest = 950 · #040848
:root {
  --brand-50: #F1F2FD;
  --brand-100: #E4E5FC;
  --brand-200: #C1C4FA;
  --brand-300: #9196FD;
  --brand-400: #5A62FC;
  --brand-500: #232EFB;
  --brand-600: #0411F0;
  --brand-700: #040fdb;
  --brand-800: #030BA0;
  --brand-900: #070D73;
  --brand-950: #040848;
  --brand: #040fdb;
  --brand-ink: #ffffff;
}

Colors that work with #040fdb

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#F4F5FA
Tinted page background
Border#C0C2ED
Hairlines and dividers
Muted text#4B4F9B
Captions on the surface
Accent#CC8F00
Second voice, not a rival
Dark variant#02097D
Hover, pressed, headers
Light variant#E6E7FF
Selected rows, tints
Dark surface#141524
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 #040fdb

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#DBD004
Analogous left#047BDB
Analogous right#6404DB
Split-complement 1#DB6404
Split-complement 2#7BDB04
Triadic 1#DB040F
Triadic 2#0FDB04
Tetradic#DB047B

RGB percentages

Red1.6%
Green5.9%
Blue85.9%

CMYK percentages

Cyan98.2%
Magenta93.2%
Yellow0.0%
Key (black)14.1%

Color previews

#040fdb text on a black background

contrast 2.10:1

Card sample

#040fdb text on a white background

contrast 10.02:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

text-shadow: 0 0 14px rgba(4, 15, 219, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(4, 15, 219, 0.45);
Border & gradient
Gradient panel
border: 3px solid #040fdb;
background: linear-gradient(135deg, #040fdb, #8804DB);

Monochromatic scale

Palettes built from #040fdb

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.

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

#040fdb, answered

What color is #040fdb?

#040fdb is a dark electric blue, closest to Medium Blue (ΔE2000 2.5). It sits at 237° on the hue wheel with 96% saturation and 44% lightness, which reads as cool.

What is the RGB value of #040fdb?

rgb(4, 15, 219) — 4 red, 15 green and 219 blue out of 255, or 1.6% / 5.9% / 85.9% by channel.

Is #040fdb a light or a dark color?

It is a dark color. Relative luminance is 0.0548 and perceived brightness is 29%, so white text on it reaches 10.02:1.

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

White. It scores 10.02:1 against #040fdb, versus 2.10:1 for black — AAA at any size.

What is the complementary color of #040fdb?

#DBD004 sits directly opposite on the wheel. Softer options are the split-complements #DB6404 and #7BDB04, which give the same contrast with far less vibration.

What colors go well with #040fdb?

For interface work: #F4F5FA as the surface, #C0C2ED for borders, #4B4F9B for secondary text, #CC8F00 as an accent and #02097D for hover and pressed states. For a palette, the analogous pair #047BDB and #6404DB stays calm, while #DBD004 is the loudest partner.

What is #040fdb in CMYK for printing?

cmyk(98%, 93%, 0%, 14%). 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 #040fdb warm or cool?

Cool — it scores 85 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #4804DB; nudged cooler, #0239DD.

Work with #040fdb in the Color Lab