Skip to content

Color functions

Free functions you can call directly in sprite code.

colorNumToRgb(num: number | string): Color

Create a Color from a Scratch color number.

Delegates to Color.num

hex(hex: string): Color

Create a Color from a hex string.

Delegates to Color.hex

rgb(r: number, g: number, b: number): Color

Create a Color from red, green, and blue components.

Delegates to Color.rgb