#040218 Color Information

Hex color code: #040218

The hex color #040218 is a dark blue with RGB values of (4, 2, 24) and HSL of (245°, 85%, 5%). It is frequently seen in web interfaces.

Try:
Color NameBlack
HEX
#040218
RGB
4, 2, 24
HSL
245°, 85%, 5%
CMYK
83%, 92%, 0%, 91%

Shades

CSS Usage
color: #040218;
background-color: #040218;
border-color: #040218;
box-shadow: 0 0 10px #040218;
border: 2px solid #040218;
Tailwind Usage
bg-[#040218]
text-[#040218]
border-[#040218]
shadow-[0_0_10px_040218]

Generate Gradient

Gradient CSS
background: linear-gradient(90deg, #040218, #FF5733);

Preview in UI

Button

.btn-primary { background-color: #040218; color: #FFFFFF; }

Badge

New Feature
.badge { background-color: #040218; color: #FFFFFF; }

Text Highlight

The quick brown fox jumps over the lazy dog. highlighted text example shows how the color looks as a text highlight.

Card

Card Title

This card uses your color as a border accent.

.card-accent { border: 2px solid #040218; background-color: #04021815; }

Alert / Toast

This is an alert using your color as accent.
.alert { background-color: #04021820; border-left: 4px solid #040218; }

Link / Accent

This is a paragraph with a link using your color. The color can be applied to interactive elements.

a { color: #040218; }

Related Colors

Complementary

Analogous

Triadic

Split Complementary

Tetradic

Monochromatic

Popular Colors

Common HEX Colors

Color Theory

Relationships based on the position of #040218 in the color wheel.

Current Complementary Triadic Analogous

RGB, HSL and CMYK Values

RGB

4, 2, 24

Red: 4 / Green: 2 / Blue: 24

HSL

245°, 85%, 5%

Hue: 245° / Saturation: 85% / Lightness: 5%

CMYK

83%, 92%, 0%, 91%

Cyan: 83% / Magenta: 92% / Yellow: 0% / Key: 91%

What color is #040218?

#040218 is a very dark shade associated with sophistication and elegance.

Color Shades

Complementary Colors

Color Palette

HEX to RGB

Convert #040218 to RGB:

rgb(4, 2, 24)HEX to RGB Converter →

HEX to HSL

Convert #040218 to HSL:

hsl(245, 85%, 5%)RGB to HSL Converter →

HEX to CMYK

Convert #040218 to CMYK:

cmyk(83%, 92%, 0%, 91%)Color Converter →

Color Meaning and Usage

A dark blue tone, #040218 has RGB (4, 2, 24) and HSL (245°, 85%, 5%). Known for evoking sophistication and elegance, this very dark shade is a common choice for dashboards and SaaS products. Lighter variations like #FFFFFF create softer gradients.

The complementary color of #040218 is #161802, creating high-contrast pairings. For softer combinations, try analogous colors like #020B18.

Use #040218 in CSS: color: #040218 or background-color: #040218. Create palettes with Color Palette Generator or check contrast with Contrast Checker.

Contrast with #040218

Sample text on this color - The quick brown fox jumps over the lazy dog.

Contrast Ratio: 1.03:1
WCAG AA: Fail
WCAG AAA: Fail

Need more control? Contrast Checker →

Frequently Asked Questions

What color is #040218?

#040218 is a dark blue color - a very dark shade that evokes sophistication and elegance.

What is the RGB value of #040218?

#040218 in RGB is (4, 2, 24) - 4 red, 2 green, and 24 blue.

How to use #040218 in CSS?

Use #040218 directly in your CSS properties like color or background-color.

What colors go well with #040218?

#161802 (complementary), #020B18 (analogous), and #000000 (lighter shade) work well with #040218.