Color utilities

Meowshapes provides a color(...) function to easily set colors for shapes and backgrounds. This is a simple wrapper around the THREE.Color constructor and returns a THREE.Color instance.

import { color } from "meowshapes";

const red = color("red");
const redHex = color("#ff0000");
const redNumber = color(0xff0000);

Theme specific colors

Meowshapes includes a default color palette accessible via the COLOR property on the Ctx object. This palette reacts to the current theme and provides a set of predefined colors for consistent styling.

background(COLOR.BACKGROUND);
sphere(32).color(COLOR.FOREGROUND);

Read more about themes and colors.