One swatch in RGB, HSL, HSV, HWB and OKLab

Use #336699 as a reference to check a color picker, a CSS declaration or a shader. Compare the same swatch in eight notations and find where round-trip errors start.

3 min read · Updated 2026-11-22

Summary

Formats#336699
HEX#336699
RGBrgb(51 102 153)
HSLhsl(210 50% 40%)
HSVhsv(210 66.7% 60%)
HWBhwb(210 20% 40%)
OKLABoklab(0.4993 -0.033 -0.093)
OKLCHoklch(0.4993 0.0987 250.43)
GLSL · sRGBvec3(0.2, 0.4, 0.6)

Read the RGB channels

33, 66 and 99 are hexadecimal. They equal 51, 102 and 153 in decimal. Dividing each by 255 gives the encoded sRGB channels 0.2, 0.4 and 0.6. A shader that expects linear light needs a separate transfer-function conversion.

Hex to GLSL Shader

Check the picker’s model

HSL lightness is halfway between the smallest and largest channels (40%). HSV value is the largest channel (60%). HWB uses the smallest channel for whiteness (20%) and one minus the largest for blackness (40%). Entering an HSV value in an HSL field changes the color.

Hex to HSV / HSB

Check the round trip

Convert the OKLCH value back to RGB and keep enough decimal places to recover 51, 102, 153. Generating a harmony intentionally changes hue. A different swatch after rotating hue is expected.

OKLCH to RGB

Tools featured in this guide

Related formats

Frequently asked questions

Can I paste HSV directly into CSS?

Use HSV in a picker that supports it. Write the CSS declaration as HEX, rgb(), hsl(), hwb(), oklab() or oklch().

Authoritative Specifications & References

More color guides