Tools / Color Converter / OKLCH → HEX

OKLCH to HEX Converter.

OKLCH to HEX renders a perceptual OKLCH color back to a six-digit hex for tools and APIs that don't yet speak oklch(). Because OKLCH can describe colors outside the sRGB gamut, very vivid values are clamped to the nearest displayable hex.

HEX —
All formats

    The OKLCH → HEX formula

    Polar → OKLab (a = C·cos H, b = C·sin H) → linear sRGB (inverse matrix + cubes) → gamma-encode → clamp 0-255 → hex.

    Worked example

    Convert oklch(28% 0.07 268):

    1. a = 0.07·cos(268°), b = 0.07·sin(268°)
    2. OKLab → linear sRGB → gamma-encode
    3. Clamp to gamut → rgb(26, 38, 75)
    4. Hex-encode → #1A264B

    JavaScript

    // oklchToRgb then rgbToHex (see colorConvert.ts)
    const rgb = oklchToRgb({l:0.28,c:0.07,h:268});
    const hex = rgbToHex(rgb); // "#1A264B"

    FAQ

    What happens to out-of-gamut OKLCH colors?

    OKLCH can express more saturated colors than an sRGB screen can show. Those are clamped per-channel to 0-255 on the way to hex, so the hex is the closest in-gamut match, not an exact equal.

    Paid links below. As an Amazon Associate we earn from qualifying purchases.

    Library

    Colour references for your next project

    Compare the original references behind this archive. Check the contents, edition and format before choosing a book.

    Book links are Amazon Associates affiliate links. Your price is unchanged; a small commission supports the archive. As an Amazon Associate we earn from qualifying purchases.

    • A Dictionary of Color Combinations by Sanzo Wada — book cover

      Sanzo Wada

      A Dictionary of Color Combinations

      The 2010 Seigensha republication of the 1933–34 original. Japanese import.

      The printed original behind this archive: Wada's 1933–34 combinations on Seigensha's matte plates, in a Japanese binding small enough to carry, and a copy you can cite. Every plate is also free to browse here, hex values and all. Already know it? Vol. 2 is a different book of his later work.

    • A Dictionary of Color Combinations Vol. 2 by Sanzo Wada — book cover

      Sanzo Wada

      A Dictionary of Color Combinations Vol. 2

      Seigensha, 2020. Japanese import.

      Wada's 1935–36 and 1938 follow-ups: 72 plates on the Japanese seasons and 165 drawn from early-century fashion, interior, and graphic design. Not in Vol. 1. Not in this archive. The book itself is a design object — Japanese binding, matte pages, zero captions.

    Torn between the two Wada dictionaries? Vol 1 vs Vol 2, compared plate by plate →

    Book links are Amazon Associates affiliate links. Your price is unchanged; a small commission supports the archive. As an Amazon Associate we earn from qualifying purchases.

    Last updated

    Looking for a combination we don’t have yet?

    Tell us the colour, mood, or palette you were after — it shapes which editorial combinations we add next.

    Did you find what you were looking for?

    Not quite? Tap what was off: