About Navy
Navy (navy) is a dark, vivid blue with the hex code #000080, or rgb(0, 0, 128). In HSL it sits at a hue of 240°, 100% saturation and 25% lightness. It is one of the 148 named colors every browser understands, so you can write color: navy; instead of the hex value.
Using Navy for text and backgrounds
| Pairing | Contrast ratio | WCAG |
|---|---|---|
| Navy text on white | 16.01 : 1 | AAA |
| Navy text on black | 1.31 : 1 | fails |
On a navy background, use white text (16.01 : 1). WCAG asks for at least 4.5 : 1 for body text and 3 : 1 for large text. Check other pairs with the Contrast Checker.
CSS
.element {
color: navy; /* or #000080 */
background-color: #000080;
border: 1px solid rgb(0 0 128 / 50%);
}
Similar named colors
Dark Blue (#00008b), Midnight Blue (#191970), Indigo (#4b0082), Medium Blue (#0000cd), Dark Slate Blue (#483d8b), Dark Slate Gray (#2f4f4f).