setTheme

The setTheme() function allows you to override the currently selected theme in the renderer.

setTheme("dark");

sphere(32);

Note! The setTheme() only affects the colors of the subsequent objects created after it, not the ones created before it.

setTheme("dark");

// This sphere will use the dark theme colors.
sphere(32);

setTheme("light");

// This sphere will use the light theme colors.
sphere(32);