blue — #0000FF
#0000FF
rgb(0, 0, 255) · hsl(240, 100%, 50%) · CSS keyword blue
Can you put text on it?
| Contrast | Body text | Large text | |
|---|---|---|---|
| blue on white | 8.59:1 | AA | AA |
| blue on black | 2.44:1 | — | — |
As a background, blue takes white text: 8.59:1 against 2.44:1 the other way. A colour picker will give you the hex and stop there, which is why so many palettes look right and fail an accessibility audit.
Using it
color: blue;
color: #0000ff;
color: rgb(0 0 255);
All three are the same colour. The keyword is one of the 141 CSS named colours — a list settled in CSS 2.1 and added to exactly once since, when rebeccapurple was standardised in 2014.
Colours close to blue
- mediumblue — #0000CD
- darkblue — #00008B
- navy — #000080
- midnightblue — #191970
- indigo — #4B0082
- darkslateblue — #483D8B
Frequently asked questions
What is the hex code for blue?
The hex code for blue is #0000FF — RGB 0, 0, 255.
Can I use blue for text?
Yes. blue reaches 8.59:1 against white, past the 4.5:1 that WCAG AA asks for body text.
Should text on blue be black or white?
White — 8.59:1 against 2.44:1 the other way.
Other named colours
- blueviolet — #8A2BE2
- brown — #A52A2A
- burlywood — #DEB887
- cadetblue — #5F9EA0
- chartreuse — #7FFF00
- chocolate — #D2691E
- coral — #FF7F50
- cornflowerblue — #6495ED
- cornsilk — #FFF8DC
- crimson — #DC143C
- cyan — #00FFFF
- darkblue — #00008B
#0000FF in full — tints, shades and harmonies · All named colours · Colour reference