effect function
Short form of `defineEffect`: defaults, optional options, setup.
import { effect } from '@dioramajs/diorama'An unnamed effect takes its registry key (the file name when a build plugin finds it).
export default effect({ strength: 1 }, ({ surface, u }) => { ... })function effect(setup: EffectSetup<Empty>): Effect<Empty>function effect<P extends ParamSpec>(
params: P & CheckSpec<P>,
setup: EffectSetup<ColorsIn<P>>,
): Effect<WidenSpec<P>>function effect<P extends ParamSpec>(
params: P & CheckSpec<P>,
options: EffectOptions<ColorsIn<P>>,
setup: EffectSetup<ColorsIn<P>>,
): Effect<WidenSpec<P>>Parameters
| Name | Type | Description |
|---|---|---|
setup | EffectSetup<Empty> |
| Name | Type | Description |
|---|---|---|
params | P & CheckSpec<P> | |
setup | EffectSetup<ColorsIn<P>> |
| Name | Type | Description |
|---|---|---|
params | P & CheckSpec<P> | |
options | EffectOptions<ColorsIn<P>> | |
setup | EffectSetup<ColorsIn<P>> |
Also exported from @dioramajs/diorama/auto, @dioramajs/diorama/effects, @dioramajs/effects, @dioramajs/effects/effect.
Defined in packages/effects/src/effect.ts.