Hex Values #040FAC

#040FAC

sRGB: 4 / 15 / 172

#040FAC belongs to the blue family. Its hex code tells a screen to mix 4 red, 15 green and 172 blue on a scale of 0 to 255. On the HSL wheel, hue is a position around a circle: 236.1° lands in the blue region. Its 95.5% saturation makes it strong in color at this lightness. HSL lightness is 34.5% on a scale from black (0%) to white (100%). Of black and white lettering, white has the clearer light-to-dark separation on this background (12.58:1), which helps the shapes of letters stand out.

Color conversions

sRGB (8-bit)
4, 15, 172
HSL
236.07°, 95.45%, 34.51%
HSV / HSB
236.07°, 97.67%, 67.45%
CMYK (approx.)
97.67%, 91.28%, 0.00%, 32.55%
CIE XYZ (D65, Y = 100 for white)
7.666, 3.346, 39.273
CIELAB (D65, 2° observer)
21.378, 54.922, -77.911
WCAG relative luminance
0.03346
24-bit decimal
266156

CMYK uses a profile-free approximation. Printed output depends on the press, ink and paper. Lab uses a D65 white point.

Text contrast

Contrast tells you how clearly lettering separates from #040FAC in light and dark. The ratio compares relative luminance, a measure of light weighted for human vision. Identical colors give 1:1 and black against white gives 21:1. A ratio of 2.99:1 falls just below the 3:1 AA minimum for large text. Body text needs at least 4.5:1 because its finer strokes are harder to distinguish.

Black text: 1.67:1

Normal text: Fail
Large text: Fail

White text: 12.58:1

Normal text: AAA
Large text: AAA

AA and AAA are WCAG accessibility levels. AAA sets a higher bar: 7:1 for normal text and 4.5:1 for large text. Large text begins at 18 pt regular or 14 pt bold. Ratings use the unrounded ratio.

Reference: WCAG text contrast guidance

Palettes & scales

Harmonies rotate the hue. Scales mix the starting color with white, black or middle gray in 20% steps in encoded sRGB.

Complementary

#ACA104 sits half a turn (180°) from #040FAC on the HSL wheel. Keeping saturation and lightness steady while crossing to the opposite hue gives you a contrasting accent. Check text contrast separately before using the pair for lettering.

Analogous

#0463AC and #4D04AC sit 30° to either side of #040FAC. The three hues are neighbors on the wheel, so you can change the color of a border or highlight while keeping it close to the original.

Triadic

#040FAC, #AC040F and #0FAC04 are spaced 120° apart, forming a triangle on the wheel. Try one for the main color and the other two for accents.

Split complementary

Start at #040FAC and look across the wheel. #AC4D04 and #63AC04 sit 30° to either side of its exact opposite, giving you two different accent choices.

Square

Starting with #040FAC, each quarter turn (90°) takes you to the next hue: #AC0463, #ACA104, then #04AC4D. Across the square, #040FAC pairs with #ACA104, and #AC0463 with #04AC4D.

Tetradic

#040FAC and #ACA104 are opposites, as are #A104AC and #0FAC04. Together they form a rectangle on the wheel, with alternating gaps of 60° and 120°.

Tints

Mixing #040FAC with white in 20% steps produces this scale. The first mixture, #363FBD, keeps 80% of the original. By #CDCFEE, the mixture is 80% white.

Shades

Mixing #040FAC with black in 20% steps produces this scale. The first mixture, #030C8A, keeps 80% of the original. By #010322, the mixture is 80% black.

Tones

Mixing #040FAC with middle gray in 20% steps produces this scale. The first mixture, #1D26A3, keeps 80% of the original. By #676989, the mixture is 80% middle gray.

Copy color codes

Hex, RGB and HSL are three ways to write this screen color. Paste any of them into a CSS color property.

Hex

#040FAC

RGB

rgb(4 15 172)

HSL

hsl(236.071 95.455% 34.510%)

CSS example

.color-sample {
  background-color: #040FAC;
  color: #FFFFFF;
}

Channel breakdown

RGB

#040FAC uses 4 red, 15 green and 172 blue. Each bar shows how much of that channel’s 0–255 range the screen uses.

Red 1.6%
Green 5.9%
Blue 67.5%

CMYK

A simple CMYK estimate for #040FAC is 97.7% cyan, 91.3% magenta, 0.0% yellow and 32.5% black. These are ink amounts; a printer profile is needed to predict the result on paper.

Cyan 97.7%
Magenta 91.3%
Yellow 0.0%
Black 32.5%

Nearby colors

The nearest shorthand match is #0011AA. Its matching digit pairs let you write it as #01A in CSS. For a modern design, keep #040FAC when you want an exact match. Use its web-safe neighbor, #000099, when matching a legacy palette of 216 colors.

Gradient to complement

Color vision previews

Compare how #040FAC appears in each simulation. When two chart lines or status indicators become hard to tell apart, a label, shape or line pattern gives readers another way to distinguish them. Individual perception varies.

Protanopia

A red–green color vision deficiency. Without a distinct response from long-wavelength cones, some reds and greens can look alike, and reds can appear darker.

#003CB0

Deuteranopia

A red–green color vision deficiency. Without a distinct response from medium-wavelength cones, some greens can be difficult to distinguish from reds or browns.

#002AAA

Tritanopia

A blue–yellow color vision deficiency. Without a distinct response from short-wavelength cones, blue can resemble green, and yellow can resemble pink.

#004864

Protanomaly (50%)

An altered long-wavelength cone response can make reds appear dimmer and harder to distinguish from greens. This swatch shows the model’s halfway setting.

#0030AE

Deuteranomaly (50%)

An altered medium-wavelength cone response can reduce the visible difference between reds and greens. This swatch shows the model’s halfway setting.

#0026AB

Tritanomaly (50%)

An altered short-wavelength cone response can make blue harder to distinguish from green. This swatch shows the model’s halfway setting.

#002B97

Grayscale (luminance)

This design check removes hue and preserves relative luminance so you can compare light and dark areas.

#333333

Partial grayscale (50% blend)

This design check mixes the original color halfway toward its grayscale equivalent in linear light. Use it to see how a design holds up as color fades.

#242682

Reference: National Eye Institute: Types of Color Vision Deficiency

Technical reference

CAM16 and CIECAM02 below assume D65 white, an average surround, background Y of 20 against white at 100, and adapting luminance of 4.07 cd/m².

Linear sRGB

These channels scale with emitted light. Use them for lighting calculations and physically meaningful blends.

R 0.00121 G 0.00478 B 0.41254

Display P3

P3 displays can reproduce a wider range of reds and greens. These coordinates reproduce this same sRGB swatch on a color-managed P3 display.

R 0.02386 G 0.05764 B 0.64685

Linear Display P3

These P3 channels are proportional to light, before display encoding.

R 0.00185 G 0.00466 B 0.37599

CIE xyY

The x and y coordinates locate chromaticity on a diagram. Y gives relative luminance on a scale where white is 100.

x 0.152 y 0.067 Y 3.346

CMY

Ideal cyan, magenta and yellow are the complements of the encoded red, green and blue channels.

C % 98.431 M % 94.118 Y % 32.549

Binary RGB

Each eight-bit group represents one channel. Together they store the 24-bit hex color.

00000100 00001111 10101100

Android ARGB

Android packs alpha, red, green and blue into a signed integer. FF means fully opaque.

0xFF040FAC -16511060

CAM16 JCh

J rates lightness relative to white. Q estimates brightness. C describes chroma, M the strength of the color sensation, and s its strength relative to brightness.

Lightness J 16.223 Chroma C 66.410 Hue h° 282.135

CAM16 JMh

J rates lightness relative to white. Q estimates brightness. C describes chroma, M the strength of the color sensation, and s its strength relative to brightness.

Lightness J 16.223 Colorfulness M 48.009 Hue h° 282.135

CAM16 Jsh

J rates lightness relative to white. Q estimates brightness. C describes chroma, M the strength of the color sensation, and s its strength relative to brightness.

Lightness J 16.223 Saturation s 98.160 Hue h° 282.135

CAM16 QCh

J rates lightness relative to white. Q estimates brightness. C describes chroma, M the strength of the color sensation, and s its strength relative to brightness.

Brightness Q 49.826 Chroma C 66.410 Hue h° 282.135

CAM16 QMh

J rates lightness relative to white. Q estimates brightness. C describes chroma, M the strength of the color sensation, and s its strength relative to brightness.

Brightness Q 49.826 Colorfulness M 48.009 Hue h° 282.135

CAM16 Qsh

J rates lightness relative to white. Q estimates brightness. C describes chroma, M the strength of the color sensation, and s its strength relative to brightness.

Brightness Q 49.826 Saturation s 98.160 Hue h° 282.135

CAM16 UCS JMh

Uniform-space coordinates make distances between nearby colors easier to compare.

J′ 24.766 M′ 32.428 Hue h° 282.135

CAM16 UCS Jab

Uniform-space coordinates make distances between nearby colors easier to compare.

J′ 24.766 a′ 6.817 b′ -31.704

CIECAM02

An earlier appearance model used in color management. Compare its predictions under the same viewing conditions as CAM16.

J 13.943 C 69.704 h° 258.957 Q 46.188 M 50.391 s 104.450

Cite this page

Choose the style requested by your instructor. The access date records when you consulted this entry. For IEEE, add the reference number assigned in your paper.

MLA

Charnell, Justin. “#040FAC Hex Color.” Hex Values, https://hexvalues.com/colors/040fac/. Accessed .

APA

Charnell, J. (n.d.). #040FAC hex color. Hex Values. Retrieved , from https://hexvalues.com/colors/040fac/

Chicago

Charnell, Justin. “#040FAC Hex Color.” Hex Values. Accessed . https://hexvalues.com/colors/040fac/.

Chicago (author-date)

Charnell, Justin. n.d. “#040FAC Hex Color.” Hex Values. Accessed . https://hexvalues.com/colors/040fac/.

IEEE

J. Charnell. “#040FAC Hex Color.” Hex Values. Accessed: . [Online]. Available: https://hexvalues.com/colors/040fac/

Discover more colors