Saturon LogoSaturon

🚧 This documentation covers a pre-1.0 release. Expect breaking changes.

RecipesRegister Color Spaces

Linear P3

A recipe to register the Linear Display P3 color space in Saturon.

import { registerColorSpace } from "saturon/utils";
import { MATRICES } from "saturon/math";

/**
 * @see {@link https://www.w3.org/TR/css-color-4/|CSS Color Module Level 4}
 */
registerColorSpace("display-p3-linear", {
    components: ["r", "g", "b"],
    bridge: "xyz-d65",
    toBridgeMatrix: MATRICES.P3_to_XYZD65,
    fromBridgeMatrix: MATRICES.XYZD65_to_P3,
});