RGB to HEX: #312C85

Also known as: Tailwind indigo-900

Result

rgb(49 44 133) → #312C85

Values are shown at full precision, so converting back gives exactly #312c85. 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. base 10 → base 16

    R = 49 = 3×16 + 1 → 31
    G = 44 = 2×16 + 12 → 2C
    B = 133 = 8×16 + 5 → 85
  2. 2. pairs → HEX

    31 2C 85 → #312C85

All formats

HEX
#312c85
RGB
rgb(49 44 133)
RGB (legacy)
rgb(49, 44, 133)
HSL
hsl(243.37 50.28% 34.71%) → hsl(243 50% 35%)
HWB
hwb(243 17% 48%)
OKLCH
oklch(0.359 0.144 278.8) · oklch(35.9% 0.144 278.8)
OKLab
oklab(0.359 0.022 -0.142)
Lab (D50)
lab(23.37 24.66 -50.32)
LCH (D50)
lch(23.37 56.04 296.10)
Display P3
color(display-p3 0.1888 0.1732 0.5020)
Linear sRGB
color(srgb-linear 0.0307 0.0252 0.2346)

Gamut: sRGB and Display P3

#312C85 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.219 and Display P3 reaches 0.222; this color uses 66% of the sRGB chroma available.

CSS snippets

.element {
  color: #312c85;
  color: rgb(49 44 133);
  color: hsl(243 50% 35%);
  color: oklch(0.359 0.144 278.8);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.359 0.144 278.8);
}
/* arbitrary values */
class="text-[#312c85] bg-[oklch(0.359_0.144_278.8)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.1888 0.1732 0.5020); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #312c85 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

  • #3F3E98 · oklch(0.419 0.144 278.8) · ΔL +0.06
  • #241972 · oklch(0.299 0.144 278.8) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?