Blue color (#0000FF)
Blue is one of the 148 CSS named colors. Use the keyword blue
anywhere CSS accepts a color, or its hex code #0000FF, which is rgb(0, 0, 255) in RGB.
It is a dark, vivid cool color with a hue angle of 240° on the HSL color wheel and a perceived lightness of 45% in OKLCH. On a blue background, white text gives the higher contrast at 8.59:1, which passes WCAG AA for normal text.
Blue color codes
| CSS name | blue |
|
|---|---|---|
| HEX | #0000FF |
|
| HEX (8-digit) | #0000FFFF |
|
| RGB | rgb(0, 0, 255) |
|
| HSL | hsl(240, 100%, 50%) |
|
| HSV / HSB | hsv(240, 100%, 100%) |
|
| OKLCH | oklch(45.2% 0.3132 264.1) |
|
| CMYK | cmyk(100%, 100%, 0%, 0%) |
Contrast with white and black
WCAG 2 contrast ratios and APCA lightness contrast (Lc) for blue used as text and as a background.
Tints and shades of blue
Tints mix blue with white; shades mix it with black, in 10% steps. Click a swatch to copy it, or build custom scales in the tint & shade generator.
Tints
Shades
Colors that go with blue
Harmonies calculated on the HSL color wheel. Explore more in the color scheme generator.
Complementary
Analogous
Triadic
Split-Complementary
Blue with color blindness
Approximately how blue appears with each type of color vision deficiency. Test full designs with the color blindness simulator.
Using blue in CSS
.element {
color: blue;
background-color: #0000ff;
border-color: rgb(0 0 255 / 50%);
outline-color: oklch(45.2% 0.3132 264.1);
}Similar named colors
See all shades of blue or browse every CSS color name.