okhsl 1.0.0

Oklab extension for HSL (Okhsl) and HSV (Okhsv) color spaces
Documentation

Convert sRGB to Okhsl/Okhsv (Oklab-based) perceptual color space

A simple Rust implementation of Okhsl and Okhsv color conversion routines based on the reference implementation in the blog post.

Okhsl and Okhsv color spaces are meant to have more orhogonal hue, saturation, and lightness than the basic HSL/HSV colors.

API

use oklab::*;
let Oklab {l, a, b} = srgb_to_oklab(RGB {r, g, b});
let Okhsv {h, s, v} = oklab_to_okhsv(Oklab {l, a, b});

Oklab components are floats. l is in range 0 to 1, and a/b are small numbers that can be negative.

Okhsv/Okhsl components are floats. HSL values are approximately in range 0 to 1 (inclusive). You can expect to roundtrip OkhslOklab and OkhsvOklab with little loss of precision.