HSB Color Mode
The same emoji. One new line in setup. Colors that say what they mean.
Pick a color below — the sketch responds live and the HSB values update in real time.
Colors That Say What They Mean.
Phase 3 makes one structural change to Phase 2: the color model switches from RGB to HSB.
One line in setup() — colorMode(HSB, 360, 100, 100) —
transforms how every fill() and stroke() call is interpreted.
All nine _R/_G/_B constant triples from Phase 2 collapse into compact,
human-readable H/S/B groups. The drawing functions are unchanged.
// PHASE 2: three constants per color, three guesses per shade — open a color picker to understand it var FACE_FILL_R = 255; var FACE_FILL_G = 204; var FACE_FILL_B = 0; var FACE_STROKE_R = 204; var FACE_STROKE_G = 136; var FACE_STROKE_B = 0; ... fill(FACE_FILL_R, FACE_FILL_G, FACE_FILL_B); // what color? requires a picker to know // PHASE 3: one color, each number says its name — readable at a glance colorMode(HSB, 360, 100, 100); // setup(): the one new line var FACE_HUE = 48; // 48° = yellow-orange on the color wheel var FACE_SAT = 100; // fully saturated — no white mixed in var FACE_BRI = 100; // full brightness var STROKE_BRI_PCT = 80; // stroke is 80% as bright as the face var FACE_STROKE_BRI = FACE_BRI * STROKE_BRI_PCT / 100; // = 80 ... fill(FACE_HUE, FACE_SAT, FACE_BRI); stroke(FACE_HUE, FACE_SAT, FACE_STROKE_BRI);
Live Animation — Phase 3
fill(48, 100, 100)
stroke(48, 100, 80)
Color picker → live HSB values update.
Stroke brightness is computed as a percentage of face brightness.