chromaticFan
Split the child into red, green and blue copies pushed apart along one direction.
chromaticFan(opts: {
strength: ArgSpec
angle: ArgSpec
red: ArgSpec
green: ArgSpec
blue: ArgSpec
}): SampleStage
Import effects from shaders/std and use effects.lens.chromaticFan.
angle is in degrees (0 pushes along x); give the prop transform: transformAngle. strength is 0–1, where 1 moves a channel by a tenth of the canvas height. red, green and blue multiply that shift per channel, usually −1, 0 and 1. Returns a sampling stage; wrap it in gatherStack to make the effect.
Parameters
| Name | Type | Notes |
|---|---|---|
opts | `{ |
strength: ArgSpec
angle: ArgSpec
red: ArgSpec
green: ArgSpec
blue: ArgSpec
}` | |
Example
effect: gatherStack(chromaticFan({strength: p('strength'), angle: p('angle'), red: p('redOffset'), green: p('greenOffset'), blue: p('blueOffset')}), [])
Tip. Alpha comes from the green copy, so keep
greenat 0 to hold the layer's outline in place.
See also
gatherStack— Assemble an effect from one sampling stage and an ordered list of overlay stages.spectralLens— Fan the child out into many color-shifted copies through a warped lens, the spectral-lens look.