q5play
    Preparing search index...

    Variable HSBConst

    HSB: "hsb"

    🎨 HSB colors have components h/hue, s/saturation, b/brightness (aka v/value), and a/alpha.

    HSB is similar to HSL, but instead of lightness (black to white), it uses brightness (black to full color). To produce white, set brightness to 100 and saturation to 0.

    • hue: 0 to 360
    • saturation: 0 to 100
    • brightness: 0 to 100
    • alpha: 0 to 1
    await Canvas(200, 100);

    colorMode(HSB);

    background(0, 100, 100);
    await Canvas(200, 220);
    noStroke();

    colorMode(HSB);
    for (let h = 0; h < 360; h += 10) {
    for (let b = 0; b <= 100; b += 10) {
    fill(h, 100, b);
    rect(h * (11 / 20) - 100, b * 2 - 110, 6, 20);
    }
    }