Skip to content

CSS named color

DarkBlue #00008B

DarkBlue (CSS keyword darkblue) has the hex code #00008B and the RGB value rgb(0, 0, 139): a very dark, vivid blue.

DarkBlue#00008B

Dark blue (#00008b) uses 139 as its blue channel, the value the X11 list uses for many of its "dark" variants. It is slightly brighter than navy (#000080).

Color codes for DarkBlue

Color codes for DarkBlue
CSS keyworddarkblue
HEX#00008B
RGBrgb(0, 0, 139)
HSLhsl(240, 100%, 27%)
HWBhwb(240 0% 45%)
OKLCHoklch(28.8% 0.199 264.1)
CMYK (naive, no ICC profile)cmyk(100%, 100%, 0%, 45%)
Decimal139
Hue familyBlues

Contrast and accessibility

On darkblue, white text has a contrast ratio of 15.29:1 and passes AAA at any text size; black text reaches 1.37: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.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on darkblue1.37:1FailFailFailFail0.0
White text on darkblue15.29:1PassPassPassPass−103.1
Darkblue text on white15.29:1PassPassPassPass100.0
Darkblue text on black1.37:1FailFailFailFail0.0

Tints and shades

Each step mixes darkblue with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, darkblue, white 25%) in CSS.

Tints (mixed with white)

  1. 5%
    #0d0d91
  2. 15%
    #26269c
  3. 25%
    #4040a8
  4. 35%
    #5959b4
  5. 45%
    #7373bf
  6. 55%
    #8c8ccb
  7. 65%
    #a6a6d6
  8. 75%
    #bfbfe2
  9. 85%
    #d9d9ee
  10. 95%
    #f2f2f9

Shades (mixed with black)

  1. 5%
    #000084
  2. 15%
    #000076
  3. 25%
    #000068
  4. 35%
    #00005a
  5. 45%
    #00004c
  6. 55%
    #00003f
  7. 65%
    #000031
  8. 75%
    #000023
  9. 85%
    #000015
  10. 95%
    #000007

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, darkblue's complementary color is #3D2600 (close to darkslategray), its analogous colors are #00304E and #370079, and its triadic partners are #5D0002 and #003800. For text on top, white gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#3d2600
Analogous−30°, +30°#00304e#370079
Triadic+120°, +240°#5d0002#003800
Split-complementary+150°, +210°#4c1800#2b2e00

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?

DarkBlue 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

Nearest CSS named colors
ColorHEXΔE OK
navy#0000802.0
midnightblue#1919706.1
mediumblue#0000cd11.6

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
violet-950#2f0d689.8
indigo-900#312c8510.0
blue-900#1c398e10.6

Code snippets

CSS
.element {
  color: darkblue;
  background-color: #00008b;
  border-color: rgb(0 0 139);
  outline-color: oklch(28.8% 0.199 264.1);
}
Tailwind CSS
<div class="bg-[#00008b] text-white">...</div>

/* or register it once in your CSS (Tailwind v4) */
@theme {
  --color-darkblue: #00008b;
}
/* then use bg-darkblue, text-darkblue, border-darkblue */
SwiftUI
import SwiftUI

extension Color {
  static let darkblue = Color(red: 0.000, green: 0.000, blue: 0.545)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

val Darkblue = Color(0xFF00008B)
Flutter
import 'package:flutter/material.dart';

const darkblue = Color(0xFF00008B);
Android XML
<!-- res/values/colors.xml -->
<color name="darkblue">#00008B</color>

Frequently asked questions

What is the hex code for darkblue?
The hex code for darkblue is #00008B. The same color is rgb(0, 0, 139), hsl(240, 100%, 27%) and oklch(28.8% 0.199 264.1), and in CSS you can also write the keyword darkblue directly.
Is darkblue a warm or cool color?
DarkBlue 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 darkblue?
Rotating the hue in OKLCH while keeping lightness and chroma, darkblue's complementary color is #3D2600 (close to darkslategray), its analogous colors are #00304E and #370079, and its triadic partners are #5D0002 and #003800. For text on top, white gives the higher contrast.
Can you use white text on darkblue?
White text on darkblue has a contrast ratio of 15.29:1, which passes both AA and AAA under WCAG 2.2. Black text reaches 1.37:1 and fails AA even for large text. In APCA terms that is Lc −103.1 for white and Lc 0.0 for black.
What is the RGB value of darkblue?
DarkBlue is rgb(0, 0, 139): red 0, green 0 and blue 139 on the 0 to 255 scale, or 0.0%, 0.0% and 54.5%. As a decimal integer it is 139.

Last reviewed by Arielton Oberek.