colorWheel
A striped gradient that slides across the canvas, cycling through its colors over time.
colorWheel(slots: {
mode: PropRef
direction: ArgSpec
scale: ArgSpec
palette: {a: PropRef; b: PropRef; c: PropRef}
space: PropRef
}): Paint
Import gradients from shaders/std and use gradients.colorWheel.
mode is a compileTime prop: 'rainbow' generates a full spectrum, 'custom' loops palette.a to b to c and back, mixed in the color space named by the space prop (also compileTime, ignored in rainbow mode). direction in degrees turns the stripes about the canvas center, scale sets how many color cycles cross the canvas (1 is a single wide sweep). It moves on the layer's clock, so declare animatedTime: {speed: 'speed'}.
Parameters
| Name | Type | Notes |
|---|---|---|
slots | `{ |
mode: PropRef
direction: ArgSpec
scale: ArgSpec
palette: {a: PropRef; b: PropRef; c: PropRef}
space: PropRef
}` | |
Example
paint: colorWheel({mode: p('mode'), direction: p('angle'), scale: p('scale'), palette: {a: p('colorA'), b: p('colorB'), c: p('colorC')}, space: p('colorSpace')})
See also
pointCloudGradient— Five colored points placed anywhere on the canvas, each pixel taking the colors of the points nearest it.