q5play
    Preparing search index...

    Variable OKLCHConst

    OKLCH: "oklch"

    🎨 OKLCH colors have components l/lightness, c/chroma, h/hue, and a/alpha. It's more intuitive for humans to work with color in these terms than RGB.

    OKLCH is perceptually uniform, meaning colors at the same lightness and chroma (colorfulness) will appear to have equal luminance, regardless of the hue.

    OKLCH can accurately represent all colors visible to the human eye, unlike many other color spaces that are bounded to a gamut. The maximum lightness and chroma values that correspond to sRGB or P3 gamut limits vary depending on the hue. Colors that are out of gamut will be clipped to the nearest in-gamut color.

    Use the OKLCH color picker to find in-gamut colors.

    • lightness: 0 to 1
    • chroma: 0 to ~0.4
    • hue: 0 to 360
    • alpha: 0 to 1
    await Canvas(200, 100);

    colorMode(OKLCH);

    background(0.64, 0.3, 30);
    await Canvas(200);
    colorMode(OKLCH);

    q5.draw = function () {
    background(0.7, 0.16, frameCount % 360);
    };