oklab

Crates.iooklab
lib.rsoklab
version1.1.2
sourcesrc
created_at2021-02-06 01:26:09.314926
updated_at2024-09-01 19:25:00.406918
descriptionOK Lab is a perceptually uniform color space for image processing. Improvement of CIELAB.
homepagehttps://bottosson.github.io/posts/oklab/
repositoryhttps://gitlab.com/kornelski/oklab
max_upload_size
id351372
size16,275
maintainers (github:rust-bus:maintainers)

documentation

README

Convert sRGB to Oklab perceptual color space

Simple Rust implementation of the Oklab color space conversion routines based on the reference implementation in the blog post.

Mixing of colors in the Oklab color space is meant to give more pleasing gradients.

API

use oklab::*;
let Oklab {l, a, b} = srgb_to_oklab(RGB {r, g, b});
let rgb = oklab_to_srgb(Oklab {l, a, b});

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

Commit count: 5

cargo fmt