Free Accessible CSS Gradient Generator

← All Colors
#0000FF Blue

Blue Hex Code #0000FF

Blue is a dark, vivid color with the hex code #0000FF. In RGB it is 0, 0, 255, and in HSL it is 240°, 100%, 50%. It is one of the 148 named colors in CSS, so you can write “blue” instead of the hex code.

HEX
#0000FF
RGB
rgb(0, 0, 255)
HSL
hsl(240, 100%, 50%)
HSV
hsv(240°, 100%, 100%)
CMYK
cmyk(100%, 100%, 0%, 0%)
CSS name
blue

CMYK is a simple screen-to-print estimate. Real print results depend on the printer and paper.

About Blue

On a white background Blue has a contrast ratio of 8.59:1 (AAA), and on black 2.44:1 (Fail). White text is the better choice on top of it.

It sits on the cool side of the color wheel, a range that tends to feel calm and appears to recede.

Blue is the most common color in interfaces. It signals trust and calm, which is why banks, software and healthcare brands favour it.

Good to know: Blue (#0000ff) is the blue channel at full intensity. It is the darkest of the three pure primaries, with a relative luminance of only about 7%, so it is hard to read as text on dark backgrounds. Brighter blues such as dodgerblue (#1e90ff) are easier to see.

Shades and tints of Blue

Tints mix Blue with white and shades mix it with black, in steps of 20%. Select a swatch to copy its hex code.

Color harmonies for Blue

These schemes are calculated from Blue on the RGB (screen) color wheel. Select a swatch to copy it, or open any scheme in the color wheel to adjust it.

Analogous

Open in the color wheel

Triadic

Open in the color wheel

Tetradic

Open in the color wheel

Square

Open in the color wheel

On the artist’s RYB wheel, the complement of Blue is #FFA600, close to the named color Orange.

Blue contrast and accessibility

WCAG asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (AA), and 7:1 and 4.5:1 for AAA. This is how Blue scores against white and black.

Contrast of Blue with white and black
AgainstRatioAA normalAA largeAAA normalAAA large
White (#ffffff) 8.59:1 ✓ Pass ✓ Pass ✓ Pass ✓ Pass
Black (#000000) 2.44:1 ✕ Fail ✕ Fail ✕ Fail ✕ Fail
Aa White text on Blue8.59:1
Aa Black text on Blue2.44:1

Blue and color blindness

These are approximate previews of how Blue can look with the main types of color vision deficiency.

Protanopia #0059FF

Blue changes noticeably.

Deuteranopia #003DFB

Blue changes noticeably.

Tritanopia #006B96

Blue changes noticeably.

Achromatopsia #4C4C4C

Blue changes noticeably.

Gradients with Blue

Three ready-made starting points. Copy the CSS, or open one in the generator to edit the stops and check contrast.

Blue to a lighter tint

background: linear-gradient(135deg, #0000ff 0%, #9999ff 100%);

Blue to its analogous neighbour

background: linear-gradient(135deg, #0000ff 0%, #8000ff 100%);

Blue to its complement

background: linear-gradient(135deg, #0000ff 0%, #ffff00 100%);

Colors similar to Blue

How each close match differs from Blue.

More blue colors →

Use Blue in code

CSS
.element {
  color: #0000ff;
  background-color: #0000ff;
  border-color: blue;   /* blue is a valid CSS color name */
}
CSS variable
:root {
  --color-blue: #0000ff;
}
Tailwind
<!-- Tailwind arbitrary values -->
<div class="bg-[#0000ff] text-[#0000ff] border-[#0000ff]"></div>

/* Tailwind v4 theme color */
@theme {
  --color-blue: #0000ff;
}

Blue questions

What is the hex code for Blue?

The hex code for Blue is #0000FF. In RGB that is rgb(0, 0, 255), and in HSL it is hsl(240, 100%, 50%).

What is the complementary color of Blue?

On the RGB (screen) color wheel, the complement of Blue is #FFFF00, which is close to Yellow. On the artist’s RYB wheel it is #FFA600, close to Orange.

Should I use white or black text on Blue?

White text. It has a contrast ratio of 8.59:1 against Blue, which is WCAG AAA. The other option scores 2.44:1.

Is Blue accessible as a text color on white?

Yes. Blue on white scores 8.59:1, which passes WCAG AA for normal text (4.5:1) and AAA (7:1).

What are darker and lighter shades of Blue?

Mixing Blue with black gives #0000CC, #000099, #000066, #000033 (20% to 80% black). Mixing it with white gives #3333FF, #6666FF, #9999FF, #CCCCFF (20% to 80% white).

More color tools