CSS named color
RoyalBlue #4169E1
RoyalBlue (CSS keyword royalblue) has the hex code #4169E1 and the RGB value rgb(65, 105, 225): a medium-dark, vivid blue.
A strong, medium blue (#4169e1). It has enough contrast with white for large text and is a common brand and button blue.
Color codes for RoyalBlue
| CSS keyword | royalblue |
|---|---|
| HEX | #4169E1 |
| RGB | rgb(65, 105, 225) |
| HSL | hsl(225, 73%, 57%) |
| HWB | hwb(225 25% 12%) |
| OKLCH | oklch(56% 0.188 266.4) |
| CMYK (naive, no ICC profile) | cmyk(71%, 53%, 0%, 12%) |
| Decimal | 4,286,945 |
| Hue family | Blues |
Contrast and accessibility
On royalblue, white text has a contrast ratio of 4.84:1 and passes AA for normal text; black text reaches 4.33: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.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on royalblue | 4.33:1 | Fail | Pass | Fail | Fail | 30.9 |
| White text on royalblue | 4.84:1 | Pass | Pass | Fail | Pass | −78.6 |
| Royalblue text on white | 4.84:1 | Pass | Pass | Fail | Pass | 73.2 |
| Royalblue text on black | 4.33:1 | Fail | Pass | Fail | Fail | −28.5 |
Tints and shades
Each step mixes royalblue with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, royalblue, white 25%) in CSS.
Tints (mixed with white)
- 5%
#4b71e3 - 15%
#5e80e6 - 25%
#718fe9 - 35%
#849eec - 45%
#97adef - 55%
#aabcf2 - 65%
#bdcbf5 - 75%
#d0daf8 - 85%
#e3e9fb - 95%
#f6f8fe
Shades (mixed with black)
- 5%
#3e64d6 - 15%
#3759bf - 25%
#314fa9 - 35%
#2a4492 - 45%
#243a7c - 55%
#1d2f65 - 65%
#17254f - 75%
#101a38 - 85%
#0a1022 - 95%
#03050b
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, royalblue's complementary color is #966D00 (close to olive), its analogous colors are #007EBE and #8254D3, and its triadic partners are #CB3532 and #008F20. For text on top, white gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #966d00 |
| Analogous | −30°, +30° | #007ebe#8254d3 |
| Triadic | +120°, +240° | #cb3532#008f20 |
| Split-complementary | +150°, +210° | #b75500#707e00 |
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?
RoyalBlue is a cool color: its hue is 225° 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
| Color | HEX | ΔE OK |
|---|---|---|
| slateblue | #6a5acd | 6.4 |
| mediumslateblue | #7b68ee | 7.8 |
| dodgerblue | #1e90ff | 10.2 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| blue-600 | #155dfc | 6.0 |
| indigo-500 | #615fff | 6.5 |
| blue-500 | #2b7fff | 7.2 |
Code snippets
.element {
color: royalblue;
background-color: #4169e1;
border-color: rgb(65 105 225);
outline-color: oklch(56% 0.188 266.4);
}<div class="bg-[#4169e1] text-white">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-royalblue: #4169e1;
}
/* then use bg-royalblue, text-royalblue, border-royalblue */import SwiftUI
extension Color {
static let royalblue = Color(red: 0.255, green: 0.412, blue: 0.882)
}import androidx.compose.ui.graphics.Color
val Royalblue = Color(0xFF4169E1)import 'package:flutter/material.dart';
const royalblue = Color(0xFF4169E1);<!-- res/values/colors.xml -->
<color name="royalblue">#4169E1</color>Frequently asked questions
- What is the hex code for royalblue?
- The hex code for royalblue is #4169E1. The same color is rgb(65, 105, 225), hsl(225, 73%, 57%) and oklch(56% 0.188 266.4), and in CSS you can also write the keyword royalblue directly.
- Is royalblue a warm or cool color?
- RoyalBlue is a cool color: its hue is 225° on the HSL wheel, in the green, blue and violet range that is conventionally called cool.
- What colors go with royalblue?
- Rotating the hue in OKLCH while keeping lightness and chroma, royalblue's complementary color is #966D00 (close to olive), its analogous colors are #007EBE and #8254D3, and its triadic partners are #CB3532 and #008F20. For text on top, white gives the higher contrast.
- Can you use white text on royalblue?
- White text on royalblue has a contrast ratio of 4.84:1, which passes AA for normal text but not AAA under WCAG 2.2. Black text reaches 4.33:1 and passes AA only for large text (24 px, or 18.66 px bold, and up). In APCA terms that is Lc −78.6 for white and Lc 30.9 for black.
- What is the RGB value of royalblue?
- RoyalBlue is rgb(65, 105, 225): red 65, green 105 and blue 225 on the 0 to 255 scale, or 25.5%, 41.2% and 88.2%. As a decimal integer it is 4286945.
Last reviewed by Arielton Oberek.