HEX to HSL: #4169E1

Also known as: CSS royalblue

Result

#4169E1 → hsl(225 73% 57%)

Values are shown at full precision, so converting back gives exactly #4169e1. The rounded form is what you normally paste into CSS.

Step-by-step math

Every number below is computed from the input, nothing is looked up.

  1. 1. RGB ÷ 255

    R = 0.2549
    G = 0.4118
    B = 0.8824
  2. 2. max, min, Δ

    max = 0.8824
    min = 0.2549
    Δ = max − min = 0.6275
  3. 3. L

    L = (max + min) / 2 = 0.5686 = 56.86%
  4. 4. S

    S = Δ / (1 − |2L − 1|) = 0.7273 = 72.73%
  5. 5. H

    max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.2549 − 0.4118) / 0.6275 + 4) = 225.00°
  6. 6. HSL

    hsl(225.00 72.73% 56.86%)

All formats

HEX
#4169e1
RGB
rgb(65 105 225)
RGB (legacy)
rgb(65, 105, 225)
HSL
hsl(225.00 72.73% 56.86%) → hsl(225 73% 57%)
HWB
hwb(225 25% 12%)
OKLCH
oklch(0.560 0.188 266.4) · oklch(56.0% 0.188 266.4)
OKLab
oklab(0.560 -0.012 -0.188)
Lab (D50)
lab(46.80 17.78 -66.66)
LCH (D50)
lch(46.80 68.99 284.94)
Display P3
color(display-p3 0.2904 0.4077 0.8525)
Linear sRGB
color(srgb-linear 0.0529 0.1413 0.7529)

Gamut: sRGB and Display P3

#4169E1 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.242 and Display P3 reaches 0.259; this color uses 78% of the sRGB chroma available.

CSS snippets

.element {
  color: #4169e1;
  color: rgb(65 105 225);
  color: hsl(225 73% 57%);
  color: oklch(0.560 0.188 266.4);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.560 0.188 266.4);
}
/* arbitrary values */
class="text-[#4169e1] bg-[oklch(0.560_0.188_266.4)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2904 0.4077 0.8525); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #4169e1 calc(l - 0.1) c h); }

Nearby colors

Closest colors in the Tailwind and CSS named palettes (OKLab distance).

Lighter and darker, same hue and chroma

  • #517CF6 · oklch(0.620 0.188 266.4) · ΔL +0.06
  • #3156CC · oklch(0.500 0.188 266.4) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?