HEX to OKLCH: #4169E1

Also known as: CSS royalblue

Result

#4169E1 → oklch(0.560 0.188 266.4)

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. sRGB → linear

    R: 65/255 = 0.25490 → 0.052861  (((x + 0.055) / 1.055)^2.4)
    G: 105/255 = 0.41176 → 0.141263  (((x + 0.055) / 1.055)^2.4)
    B: 225/255 = 0.88235 → 0.752942  (((x + 0.055) / 1.055)^2.4)
  2. 2. linear sRGB → LMS

    l = 0.4122·R + 0.5363·G + 0.0514·B = 0.136290
    m = 0.2119·R + 0.6807·G + 0.1074·B = 0.188223
    s = 0.0883·R + 0.2817·G + 0.6300·B = 0.518802
  3. 3. cube root

    l′ = ∛0.136290 = 0.514622
    m′ = ∛0.188223 = 0.573092
    s′ = ∛0.518802 = 0.803527
  4. 4. LMS′ → Oklab

    L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.55985
    a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = -0.01182
    b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = -0.18786
  5. 5. Oklab → OKLCH

    C = √(a² + b²) = 0.18823
    H = atan2(b, a) = 266.400°
    L = 0.55985
  6. 6. OKLCH

    oklch(0.55985 0.18823 266.400)
    rounded: oklch(0.560 0.188 266.4)

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?