Skip to main content

Class: RandomColorGenerator

Defined in: src/utils/ManimColor.ts:390

A generator of random colors, deterministic when given a seed.

Ports ManimCE's RandomColorGenerator. With a seed, the same sequence of colors is produced every time (see the module note on the PRNG). Without a seed, Math.random is used and the output is non-deterministic.

Constructors​

Constructor​

new RandomColorGenerator(seed?, sampleColors?): RandomColorGenerator

Defined in: src/utils/ManimColor.ts:394

Parameters​

seed?​

number

sampleColors?​

readonly ParsableManimColor[]

Returns​

RandomColorGenerator

Methods​

next()​

next(): ManimColor

Defined in: src/utils/ManimColor.ts:403

Return the next random color from the configured palette.

Returns​

ManimColor