Skip to content

CSS named color

MediumBlue #0000CD

MediumBlue (CSS keyword mediumblue) has the hex code #0000CD and the RGB value rgb(0, 0, 205): a dark, vivid blue.

MediumBlue#0000CD

A deep, saturated blue (#0000cd), between blue and darkblue. It has very high contrast with white, above 10:1.

Color codes for MediumBlue

Color codes for MediumBlue
CSS keywordmediumblue
HEX#0000CD
RGBrgb(0, 0, 205)
HSLhsl(240, 100%, 40%)
HWBhwb(240 0% 20%)
OKLCHoklch(38.3% 0.266 264.1)
CMYK (naive, no ICC profile)cmyk(100%, 100%, 0%, 20%)
Decimal205
Hue familyBlues

Contrast and accessibility

On mediumblue, white text has a contrast ratio of 11.16:1 and passes AAA at any text size; black text reaches 1.88: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 mediumblue1.88:1FailFailFailFail11.5
White text on mediumblue11.16:1PassPassPassPass−96.6
Mediumblue text on white11.16:1PassPassPassPass92.4
Mediumblue text on black1.88:1FailFailFailFail−10.0

Tints and shades

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

Tints (mixed with white)

  1. 5%
    #0d0dd0
  2. 15%
    #2626d5
  3. 25%
    #4040da
  4. 35%
    #5959df
  5. 45%
    #7373e4
  6. 55%
    #8c8ce9
  7. 65%
    #a6a6ee
  8. 75%
    #bfbff3
  9. 85%
    #d9d9f8
  10. 95%
    #f2f2fd

Shades (mixed with black)

  1. 5%
    #0000c3
  2. 15%
    #0000ae
  3. 25%
    #00009a
  4. 35%
    #000085
  5. 45%
    #000071
  6. 55%
    #00005c
  7. 65%
    #000048
  8. 75%
    #000033
  9. 85%
    #00001f
  10. 95%
    #00000a

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, mediumblue's complementary color is #5B3D00 (close to saddlebrown), its analogous colors are #004A72 and #5300AF, and its triadic partners are #890009 and #005500. For text on top, white gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#5b3d00
Analogous−30°, +30°#004a72#5300af
Triadic+120°, +240°#890009#005500
Split-complementary+150°, +210°#712b00#434800

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?

MediumBlue 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
blue#0000ff8.3
darkblue#00008b11.6
navy#00008013.7

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
blue-800#193cb87.8
indigo-800#372aac8.9
indigo-700#432dd79.7

Code snippets

CSS
.element {
  color: mediumblue;
  background-color: #0000cd;
  border-color: rgb(0 0 205);
  outline-color: oklch(38.3% 0.266 264.1);
}
Tailwind CSS
<div class="bg-[#0000cd] text-white">...</div>

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

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

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

const mediumblue = Color(0xFF0000CD);
Android XML
<!-- res/values/colors.xml -->
<color name="mediumblue">#0000CD</color>

Frequently asked questions

What is the hex code for mediumblue?
The hex code for mediumblue is #0000CD. The same color is rgb(0, 0, 205), hsl(240, 100%, 40%) and oklch(38.3% 0.266 264.1), and in CSS you can also write the keyword mediumblue directly.
Is mediumblue a warm or cool color?
MediumBlue 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 mediumblue?
Rotating the hue in OKLCH while keeping lightness and chroma, mediumblue's complementary color is #5B3D00 (close to saddlebrown), its analogous colors are #004A72 and #5300AF, and its triadic partners are #890009 and #005500. For text on top, white gives the higher contrast.
Can you use white text on mediumblue?
White text on mediumblue has a contrast ratio of 11.16:1, which passes both AA and AAA under WCAG 2.2. Black text reaches 1.88:1 and fails AA even for large text. In APCA terms that is Lc −96.6 for white and Lc 11.5 for black.
What is the RGB value of mediumblue?
MediumBlue is rgb(0, 0, 205): red 0, green 0 and blue 205 on the 0 to 255 scale, or 0.0%, 0.0% and 80.4%. As a decimal integer it is 205.

Last reviewed by Arielton Oberek.