RGB to HEX: #314158

Also known as: Tailwind slate-700

Result

rgb(49 65 88) → #314158

Values are shown at full precision, so converting back gives exactly #314158. 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 = 65 = 4×16 + 1 → 41
    B = 88 = 5×16 + 8 → 58
  2. 2. pairs → HEX

    31 41 58 → #314158

All formats

HEX
#314158
RGB
rgb(49 65 88)
RGB (legacy)
rgb(49, 65, 88)
HSL
hsl(215.38 28.47% 26.86%) → hsl(215 28% 27%)
HWB
hwb(215 19% 65%)
OKLCH
oklch(0.372 0.045 257.4) · oklch(37.2% 0.045 257.4)
OKLab
oklab(0.372 -0.010 -0.044)
Lab (D50)
lab(26.92 -1.43 -16.03)
LCH (D50)
lch(26.92 16.09 264.91)
Display P3
color(display-p3 0.2049 0.2531 0.3375)
Linear sRGB
color(srgb-linear 0.0307 0.0529 0.0976)

Gamut: sRGB and Display P3

#314158 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.134 and Display P3 reaches 0.171; this color uses 33% of the sRGB chroma available.

CSS snippets

.element {
  color: #314158;
  color: rgb(49 65 88);
  color: hsl(215 28% 27%);
  color: oklch(0.372 0.045 257.4);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.372 0.045 257.4);
}
/* arbitrary values */
class="text-[#314158] bg-[oklch(0.372_0.045_257.4)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2049 0.2531 0.3375); }
}

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

  • #415169 · oklch(0.432 0.045 257.4) · ΔL +0.06
  • #223147 · oklch(0.312 0.045 257.4) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?