Basic HTML and CSS color
Navy #000080
Navy (CSS keyword navy) has the hex code #000080 and the RGB value rgb(0, 0, 128): a very dark, vivid blue.
Navy (#000080) is one of the 16 original HTML colors, half-intensity blue. The name comes from the dark blue uniforms of the British Royal Navy.
Color codes for Navy
| CSS keyword | navy |
|---|---|
| HEX | #000080 |
| RGB | rgb(0, 0, 128) |
| HSL | hsl(240, 100%, 25%) |
| HWB | hwb(240 0% 50%) |
| OKLCH | oklch(27.1% 0.188 264.1) |
| CMYK (naive, no ICC profile) | cmyk(100%, 100%, 0%, 50%) |
| Decimal | 128 |
| Hue family | Blues |
Contrast and accessibility
On navy, white text has a contrast ratio of 16.00:1 and passes AAA at any text size; black text reaches 1.31:1.
WCAG 2.2 contrast ratios (success criteria 1.4.3 and 1.4.6: AA needs 4.5:1 for normal text and 3:1 for large text, AAA needs 7:1 and 4.5:1). APCA Lc is the lightness contrast from the APCA-W3 0.0.98G model proposed for WCAG 3; a higher absolute value is more readable, and Lc 75 is its suggested minimum for body text.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on navy | 1.31:1 | Fail | Fail | Fail | Fail | 0.0 |
| White text on navy | 16.00:1 | Pass | Pass | Pass | Pass | −103.9 |
| Navy text on white | 16.00:1 | Pass | Pass | Pass | Pass | 100.9 |
| Navy text on black | 1.31:1 | Fail | Fail | Fail | Fail | 0.0 |
Tints and shades
Each step mixes navy with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, navy, white 25%) in CSS.
Tints (mixed with white)
- 5%
#0d0d86 - 15%
#262693 - 25%
#4040a0 - 35%
#5959ac - 45%
#7373b9 - 55%
#8c8cc6 - 65%
#a6a6d3 - 75%
#bfbfdf - 85%
#d9d9ec - 95%
#f2f2f9
Shades (mixed with black)
- 5%
#00007a - 15%
#00006d - 25%
#000060 - 35%
#000053 - 45%
#000046 - 55%
#00003a - 65%
#00002d - 75%
#000020 - 85%
#000013 - 95%
#000006
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, navy's complementary color is #372200 (close to darkslategray), its analogous colors are #002B48 and #320070, and its triadic partners are #550001 and #003300. For text on top, white gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #372200 |
| Analogous | −30°, +30° | #002b48#320070 |
| Triadic | +120°, +240° | #550001#003300 |
| Split-complementary | +150°, +210° | #461500#272a00 |
Computed in OKLCH: the hue is rotated by 180° (complementary), ±30° (analogous), ±120° (triadic) and 180° ±30° (split-complementary) while lightness and chroma stay fixed. Results that fall outside sRGB are brought back with the CSS Color 4 gamut mapping algorithm. Because this uses OKLCH, the values differ from tools that rotate hue in HSL, but every color keeps the same perceived lightness.
Warm or cool?
Navy is a cool color: its hue is 240° on the HSL wheel, in the green, blue and violet range that is conventionally called cool.
Nearest named and Tailwind colors
Distance is ΔE OK, the Euclidean distance in OKLab multiplied by 100. Values under about 2 are hard to tell apart side by side.
Nearest CSS named colors
| Color | HEX | ΔE OK |
|---|---|---|
| darkblue | #00008b | 2.0 |
| midnightblue | #191970 | 5.4 |
| mediumblue | #0000cd | 13.7 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| violet-950 | #2f0d68 | 9.0 |
| blue-950 | #162456 | 9.8 |
| indigo-950 | #1e1a4d | 10.6 |
Code snippets
.element {
color: navy;
background-color: #000080;
border-color: rgb(0 0 128);
outline-color: oklch(27.1% 0.188 264.1);
}<div class="bg-[#000080] text-white">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-navy: #000080;
}
/* then use bg-navy, text-navy, border-navy */import SwiftUI
extension Color {
static let navy = Color(red: 0.000, green: 0.000, blue: 0.502)
}import androidx.compose.ui.graphics.Color
val Navy = Color(0xFF000080)import 'package:flutter/material.dart';
const navy = Color(0xFF000080);<!-- res/values/colors.xml -->
<color name="navy">#000080</color>Frequently asked questions
- What is the hex code for navy?
- The hex code for navy is #000080. The same color is rgb(0, 0, 128), hsl(240, 100%, 25%) and oklch(27.1% 0.188 264.1), and in CSS you can also write the keyword navy directly.
- Is navy a warm or cool color?
- Navy is a cool color: its hue is 240° on the HSL wheel, in the green, blue and violet range that is conventionally called cool.
- What colors go with navy?
- Rotating the hue in OKLCH while keeping lightness and chroma, navy's complementary color is #372200 (close to darkslategray), its analogous colors are #002B48 and #320070, and its triadic partners are #550001 and #003300. For text on top, white gives the higher contrast.
- Can you use white text on navy?
- White text on navy has a contrast ratio of 16.00:1, which passes both AA and AAA under WCAG 2.2. Black text reaches 1.31:1 and fails AA even for large text. In APCA terms that is Lc −103.9 for white and Lc 0.0 for black.
- What is the RGB value of navy?
- Navy is rgb(0, 0, 128): red 0, green 0 and blue 128 on the 0 to 255 scale, or 0.0%, 0.0% and 50.2%. As a decimal integer it is 128.
Last reviewed by Arielton Oberek.