# effect

function in `@dioramajs/diorama`

```ts
import { effect } from '@dioramajs/diorama'
```

Short form of `defineEffect`: defaults, optional options, setup. An unnamed effect takes its
registry key (the file name when a build plugin finds it).

    export default effect({ strength: 1 }, ({ surface, u }) => { ... })

```ts
function effect(setup: EffectSetup<Empty>): Effect<Empty>
```

| Parameter | Type | Description |
| --- | --- | --- |
| `setup` | `EffectSetup<Empty>` |  |

```ts
function effect<P extends ParamSpec>(
  params: P & CheckSpec<P>,
  setup: EffectSetup<ColorsIn<P>>,
): Effect<WidenSpec<P>>
```

| Parameter | Type | Description |
| --- | --- | --- |
| `params` | `P & CheckSpec<P>` |  |
| `setup` | `EffectSetup<ColorsIn<P>>` |  |

```ts
function effect<P extends ParamSpec>(
  params: P & CheckSpec<P>,
  options: EffectOptions<ColorsIn<P>>,
  setup: EffectSetup<ColorsIn<P>>,
): Effect<WidenSpec<P>>
```

| Parameter | 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](https://github.com/MasterKurosava/diorama/blob/main/packages/effects/src/effect.ts#L256).
