CSS named color

Medium Blue #0000CD

The CSS keyword mediumblue is #0000CD. It is a dark vivid blue in the blue family. In OKLCH it sits at lightness 0.383, chroma 0.266 and hue 264.1°.

Relative luminance
0.0441
OKLCH L · C · h
0.383 · 0.266 · 264.1
Best text
White 11.16:1
Hue family
Blue

#0000CD color codes

HEX
#0000CD
RGB
rgb(0, 0, 205)
HSL
hsl(240, 100%, 40%)
OKLCH
oklch(0.383 0.266 264.1)
OKLab
oklab(0.383 -0.028 -0.264)
CIELAB (D65)
L* 24.97, a* 67.18, b* -91.50
XYZ (D65)
X 11.02, Y 4.41, Z 58.02
CMYK (naive)
cmyk(100%, 100%, 0%, 20%)

CIELAB and XYZ use the D65 white point; CSS lab() uses D50, so paste the OKLCH or HEX value into stylesheets. CMYK here is a plain formula with no press profile.

Legibility

Contrast: is #0000CD accessible?

White text on it reaches 11.16:1, passing AAA. Black text fails at 1.88:1.

WCAG 2 gives the same ratio whichever color is the text; APCA does not, so its Lc changes sign and size with polarity.

Open the Contrast System
  • Black text on it

    1.88:1

    • AA fails
    • AA large fails
    • AAA fails
    • APCA Lc +11
  • White text on it

    11.16:1

    • AA passes
    • AA large passes
    • AAA passes
    • APCA Lc −96
  • As text on black

    1.88:1

    • AA fails
    • AA large fails
    • AAA fails
    • APCA Lc −10
  • As text on white

    11.16:1

    • AA passes
    • AA large passes
    • AAA passes
    • APCA Lc +92

Nearest versions that pass 4.5:1

  • For text on white

    #0000CD 11.16:1

    It already reaches 11.16:1 on white, so no change is needed.

  • For text on black

    #2C68FF 4.53:1

    Lightening its OKLCH lightness from 0.38 to 0.57 reaches 4.53:1 on black, keeping the hue.

Checking another pair? Use the Contrast Checker.

Studio

Adjust #0000CD live

Move lightness, chroma and hue in OKLCH, or drag on the map. The map is every lightness and chroma at the current hue: sRGB inside the solid area, Display P3 out to the dashed line.

The studio needs JavaScript.

Scale

Shades and tints of #0000CD

Eleven OKLCH lightness steps at this hue, each with its contrast against white and black. #0000CD sits at step 800.

  1. 50#F0F5FF
    White
    1.09
    Black
    19.21
  2. 100#E2ECFF
    White
    1.18
    Black
    17.67
  3. 200#C4D8FF
    White
    1.43
    Black
    14.61
  4. 300#9DBDFF
    White
    1.88
    Black
    11.15
  5. 400#719EFF
    White
    2.61
    Black
    8.03
  6. 500#447CFF
    White
    3.76
    Black
    5.57
  7. 600#1B57FF
    White
    5.44
    Black
    3.85
  8. 700#0338E4
    White
    7.80
    Black
    2.68
  9. 800This color#0000CD
    White
    11.16
    Black
    1.88
  10. 900#00127A
    White
    15.35
    Black
    1.36
  11. 950#000053
    White
    18.66
    Black
    1.12

Under each step, white and black text on it; a bold figure passes 4.5:1.

Gamut

How vivid #0000CD can get

At its lightness and hue, sRGB reaches OKLCH chroma 0.228; #0000CD uses 100% of it. Display P3, which many recent phones and laptops show, reaches 0.266 there: 17% more.

0.00.20.40.60.80.20.40.60.8 460480500520540560580600620
  • sRGB
  • Display P3
  • Rec. 2020
  • Dominant wavelength
OKLCH chroma
0.266
sRGB edge
0.228
Display P3 edge
0.266
Rec. 2020 edge
0.282
Dominant wavelength
464 nm
Excitation purity
93%
Chromaticity
x 0.1500, y 0.0600
  • This color#0000CD
  • Most vivid in sRGB#0024B9
  • Most vivid in Display P3oklch(0.383 0.266 264.1)

On a screen without Display P3 the last tile shows the sRGB edge instead.

Use the wider color where screens show it
.accent {
  color: #0000cd;
}
@media (color-gamut: p3) {
  .accent { color: color(display-p3 0 0 0.7713); }
}

Mixing

Mixing #0000CD

Each row is the same mix worked out in a different space, with the halfway color at its end. sRGB, which older CSS gradients use, can sag gray or dark in the middle; OKLab keeps the lightness steps even; OKLCH holds chroma and hue as it goes.

White #FFFFFF

  • sRGB50%#8080E6
  • OKLab50%#7199EE
  • OKLCH50%#7199EE

Black #000000

  • sRGB50%#000067
  • OKLab50%#00004E
  • OKLCH50%#00004E

Its complement #573F00

  • sRGB50%#2C2067
  • OKLab50%#294175
  • OKLCH50%#005040
In CSS
/* A gradient and a mix, worked out in OKLCH */
background: linear-gradient(in oklch, #0000cd, white);
color: color-mix(in oklch, #0000cd 50%, white);

In use

#0000CD in an interface

A button, a link, a heading, a focused field, an icon and a chart line in this color, on a light page and a dark one. Each check is a WCAG 2 contrast minimum: 1.4.3 for text, 1.4.11 for the rest.

Light page

  • Button labelText, 4.5:111.16:1 Passes
  • Link and body-size textText, 4.5:111.16:1 Passes
  • Large headingLarge text, 3:111.16:1 Passes
  • Icons, borders and focus ringsNon-text, 3:111.16:1 Passes

Dark page

  • Button labelText, 4.5:111.16:1 Passes
  • Link and body-size textText, 4.5:11.67:1 Fails
  • Large headingLarge text, 3:11.67:1 Fails
  • Icons, borders and focus ringsNon-text, 3:11.67:1 Fails

For text on this page, the nearest shade that passes is #3973FF 4.52:1

Color vision

How #0000CD looks with color blindness

Achromatopsia changes it most, ΔE2000 31.9; deuteranopia changes it least, 6.3.

Simulated with Machado et al. (2009) at full severity, in linear light.

Simulate a whole page What each type sees
  • Protanopia

    No working red (long-wavelength) cones

    #0046D2 ΔE2000 12.5

    Distinct

    Reads as dark vivid blue

  • Deuteranopia

    No working green (medium-wavelength) cones

    #002FCA ΔE2000 6.3

    Noticeable

    Reads as dark vivid blue

  • Tritanopia

    No working blue (short-wavelength) cones

    #005577 ΔE2000 20.4

    Distinct

    Reads as dark muted blue

  • Achromatopsia

    No cone color vision; lightness only

    #3B3B3B ΔE2000 31.9

    Distinct

    Reads as dark gray

Pairing check

Checked against its complement, #573F00. Their lightness contrast is only 1.12:1, so where hue collapses, add a label, icon or pattern.

VisionThe pairΔE2000Verdict
Normal vision#0000CD · #573F0058.2Stays distinct
Protanopia#0046D2 · #493F0057.9Stays distinct
Deuteranopia#002FCA · #4F450360.1Stays distinct
Tritanopia#005577 · #60373435.5Stays distinct
Achromatopsia#3B3B3B · #4343432.6Easily confused

Harmony

Color harmonies for #0000CD

Its complement is #573F00, a dark muted brown, on the warm side of the wheel.

Hue rotations in OKLCH, mapped into sRGB by trimming chroma so hue and lightness stay put.

Open the Harmony Studio
  • Base#0000CD
  • Complement#573F00

Complementary

Open in Harmony Studio
  • −30°#004967
  • Base#0000CD
  • +30°#5100A5
  • Base#0000CD
  • +120°#830014
  • +240°#00530C
  • Base#0000CD
  • +150°#693200
  • +210°#434800

Split-complementary

Open in Harmony Studio

Code

Design tokens

Ready-to-paste tokens in six formats. Rename them to fit your system.

CSS custom property

:root {
  --color-mediumblue: #0000cd;
}

Tailwind config

// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      colors: {
        mediumblue: '#0000cd',
      },
    },
  },
};

Tailwind v4 theme

/* app.css — Tailwind CSS v4 */
@import "tailwindcss";

@theme {
  --color-mediumblue: oklch(0.383 0.266 264.1);
}

Design token (W3C DTCG)

{
  "color": {
    "mediumblue": {
      "$type": "color",
      "$value": {
        "colorSpace": "srgb",
        "components": [0, 0, 0.8039],
        "hex": "#0000cd"
      },
      "$description": "CSS named color mediumblue"
    }
  }
}

SwiftUI color

import SwiftUI

enum Palette {
    static let mediumblue = Color(.sRGB, red: 0.000, green: 0.000, blue: 0.804, opacity: 1)
}

Jetpack Compose color

import androidx.compose.ui.graphics.Color

object Palette {
    val Mediumblue = Color(0xFF0000CD)
}

Matches

The nearest match in each system

The closest CSS name, Tailwind shade, RAL Classic paint and Crayola crayon by ΔE2000; under 2 is hard to tell apart side by side. RAL and Crayola values approximate physical colors.

Tools

Open #0000CD in the tools

Each opens over this page. More colors live in the Color Library, and every color page is listed on the hub.