🎨
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
Example
awaitCanvas(200, 100);
colorMode(HSB);
background(0, 100, 100);
Example
awaitCanvas(200, 220); noStroke();
colorMode(HSB); for (leth = 0; h < 360; h += 10) { for (letb = 0; b <= 100; b += 10) { fill(h, 100, b); rect(h * (11 / 20) - 100, b * 2 - 110, 6, 20); } }
🎨 HSB colors have components
h/hue,s/saturation,b/brightness(akav/value), anda/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 360saturation: 0 to 100brightness: 0 to 100alpha: 0 to 1