Free Accessible CSS Gradient Generator

← All Colors
#0000CD Medium Blue

Medium Blue Hex Code #0000CD

Medium Blue is a dark, vivid blue with the hex code #0000CD. In RGB it is 0, 0, 205, and in HSL it is 240°, 100%, 40%. It is one of the 148 named colors in CSS, so you can write “mediumblue” instead of the hex code.

HEX
#0000CD
RGB
rgb(0, 0, 205)
HSL
hsl(240, 100%, 40%)
HSV
hsv(240°, 100%, 80%)
CMYK
cmyk(100%, 100%, 0%, 20%)
CSS name
mediumblue

CMYK is a simple screen-to-print estimate. Real print results depend on the printer and paper.

About Medium Blue

On a white background Medium Blue has a contrast ratio of 11.16:1 (AAA), and on black 1.88:1 (Fail). White text is the better choice on top of it.

It sits on the cool side of the color wheel, a range that tends to feel calm and appears to recede.

Blue is the most common color in interfaces. It signals trust and calm, which is why banks, software and healthcare brands favour it.

Shades and tints of Medium Blue

Tints mix Medium Blue with white and shades mix it with black, in steps of 20%. Select a swatch to copy its hex code.

Color harmonies for Medium Blue

These schemes are calculated from Medium Blue on the RGB (screen) color wheel. Select a swatch to copy it, or open any scheme in the color wheel to adjust it.

Analogous

Open in the color wheel

Triadic

Open in the color wheel

Tetradic

Open in the color wheel

Square

Open in the color wheel

On the artist’s RYB wheel, the complement of Medium Blue is #CD8500, close to the named color Dark Goldenrod.

Medium Blue contrast and accessibility

WCAG asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (AA), and 7:1 and 4.5:1 for AAA. This is how Medium Blue scores against white and black.

Contrast of Medium Blue with white and black
AgainstRatioAA normalAA largeAAA normalAAA large
White (#ffffff) 11.16:1 ✓ Pass ✓ Pass ✓ Pass ✓ Pass
Black (#000000) 1.88:1 ✕ Fail ✕ Fail ✕ Fail ✕ Fail
Aa White text on Medium Blue11.16:1
Aa Black text on Medium Blue1.88:1

Medium Blue and color blindness

These are approximate previews of how Medium Blue can look with the main types of color vision deficiency.

Protanopia #0046D2

Medium Blue changes noticeably.

Deuteranopia #002FCA

Medium Blue changes noticeably.

Tritanopia #005577

Medium Blue changes noticeably.

Achromatopsia #3B3B3B

Medium Blue changes noticeably.

Gradients with Medium Blue

Three ready-made starting points. Copy the CSS, or open one in the generator to edit the stops and check contrast.

Medium Blue to a lighter tint

background: linear-gradient(135deg, #0000cd 0%, #9999eb 100%);

Medium Blue to its analogous neighbour

background: linear-gradient(135deg, #0000cd 0%, #6700cd 100%);

Medium Blue to its complement

background: linear-gradient(135deg, #0000cd 0%, #cdcd00 100%);

Colors similar to Medium Blue

How each close match differs from Medium Blue.

More blue colors →

Use Medium Blue in code

CSS
.element {
  color: #0000cd;
  background-color: #0000cd;
  border-color: mediumblue;   /* mediumblue is a valid CSS color name */
}
CSS variable
:root {
  --color-medium-blue: #0000cd;
}
Tailwind
<!-- Tailwind arbitrary values -->
<div class="bg-[#0000cd] text-[#0000cd] border-[#0000cd]"></div>

/* Tailwind v4 theme color */
@theme {
  --color-medium-blue: #0000cd;
}

Medium Blue questions

What is the hex code for Medium Blue?

The hex code for Medium Blue is #0000CD. In RGB that is rgb(0, 0, 205), and in HSL it is hsl(240, 100%, 40%).

What is the complementary color of Medium Blue?

On the RGB (screen) color wheel, the complement of Medium Blue is #CDCD00, which is close to Gold. On the artist’s RYB wheel it is #CD8500, close to Dark Goldenrod.

Should I use white or black text on Medium Blue?

White text. It has a contrast ratio of 11.16:1 against Medium Blue, which is WCAG AAA. The other option scores 1.88:1.

Is Medium Blue accessible as a text color on white?

Yes. Medium Blue on white scores 11.16:1, which passes WCAG AA for normal text (4.5:1) and AAA (7:1).

What are darker and lighter shades of Medium Blue?

Mixing Medium Blue with black gives #0000A4, #00007B, #000052, #000029 (20% to 80% black). Mixing it with white gives #3333D7, #6666E1, #9999EB, #CCCCF5 (20% to 80% white).

More color tools