Free Accessible CSS Gradient Generator

← All Colors
#4169E1 Royal Blue

Royal Blue Hex Code #4169E1

Royal Blue is a medium, strong blue with the hex code #4169E1. In RGB it is 65, 105, 225, and in HSL it is 225°, 73%, 57%. It is one of the 148 named colors in CSS, so you can write “royalblue” instead of the hex code.

HEX
#4169E1
RGB
rgb(65, 105, 225)
HSL
hsl(225, 73%, 57%)
HSV
hsv(225°, 71%, 88%)
CMYK
cmyk(71%, 53%, 0%, 12%)
CSS name
royalblue

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

About Royal Blue

On a white background Royal Blue has a contrast ratio of 4.85:1 (AA), and on black 4.33:1 (AA Large). 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 Royal Blue

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

Color harmonies for Royal Blue

These schemes are calculated from Royal 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 Royal Blue is #E19141, close to the named color Peru.

Royal 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 Royal Blue scores against white and black.

Contrast of Royal Blue with white and black
AgainstRatioAA normalAA largeAAA normalAAA large
White (#ffffff) 4.85:1 ✓ Pass ✓ Pass ✕ Fail ✓ Pass
Black (#000000) 4.33:1 ✕ Fail ✓ Pass ✕ Fail ✕ Fail
Aa White text on Royal Blue4.85:1
Aa Black text on Royal Blue4.33:1

Royal Blue and color blindness

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

Protanopia #0879E5

Royal Blue shifts slightly.

Deuteranopia #006ADF

Royal Blue shifts slightly.

Tritanopia #00869B

Royal Blue changes noticeably.

Achromatopsia #717171

Royal Blue changes noticeably.

Gradients with Royal Blue

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

Royal Blue to a lighter tint

background: linear-gradient(135deg, #4169e1 0%, #b3c3f3 100%);

Royal Blue to its analogous neighbour

background: linear-gradient(135deg, #4169e1 0%, #6941e1 100%);

Royal Blue to its complement

background: linear-gradient(135deg, #4169e1 0%, #e1b941 100%);

Colors similar to Royal Blue

How each close match differs from Royal Blue.

More blue colors →

Use Royal Blue in code

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

/* Tailwind v4 theme color */
@theme {
  --color-royal-blue: #4169e1;
}

Royal Blue questions

What is the hex code for Royal Blue?

The hex code for Royal Blue is #4169E1. In RGB that is rgb(65, 105, 225), and in HSL it is hsl(225, 73%, 57%).

What is the complementary color of Royal Blue?

On the RGB (screen) color wheel, the complement of Royal Blue is #E1B941, which is close to Goldenrod. On the artist’s RYB wheel it is #E19141, close to Peru.

Should I use white or black text on Royal Blue?

White text. It has a contrast ratio of 4.85:1 against Royal Blue, which is WCAG AA. The other option scores 4.33:1.

Is Royal Blue accessible as a text color on white?

Yes. Royal Blue on white scores 4.85:1, which passes WCAG AA for normal text (4.5:1).

What are darker and lighter shades of Royal Blue?

Mixing Royal Blue with black gives #3454B4, #273F87, #1A2A5A, #0D152D (20% to 80% black). Mixing it with white gives #6787E7, #8DA5ED, #B3C3F3, #D9E1F9 (20% to 80% white).

More color tools