🎨 Sets the color mode for the sketch, which changes how colors are interpreted and displayed.
Color gamut is 'display-p3' by default, if the device supports HDR.
The default color mode is RGB in float format.
color mode
color format (1 for float, 255 for integer)
Optional
color gamut
await Canvas(200);colorMode(RGB, 1);fill(1, 0, 0);rect(-100, -100, 66, 200);fill(0, 1, 0);rect(-34, -100, 67, 200);fill(0, 0, 1);rect(33, -100, 67, 200); Copy
await Canvas(200);colorMode(RGB, 1);fill(1, 0, 0);rect(-100, -100, 66, 200);fill(0, 1, 0);rect(-34, -100, 67, 200);fill(0, 0, 1);rect(33, -100, 67, 200);
await Canvas(200);colorMode(OKLCH);fill(0.25, 0.15, 0);rect(-100, -100, 100, 200);fill(0.75, 0.15, 0);rect(0, -100, 100, 200); Copy
await Canvas(200);colorMode(OKLCH);fill(0.25, 0.15, 0);rect(-100, -100, 100, 200);fill(0.75, 0.15, 0);rect(0, -100, 100, 200);
🎨 Sets the color mode for the sketch, which changes how colors are interpreted and displayed.
Color gamut is 'display-p3' by default, if the device supports HDR.
The default color mode is RGB in float format.