---
title: "chromaticFan"
description: "Split the child into red, green and blue copies pushed apart along one direction."
group: "effects"
groupTitle: "Filters & effects"
categoryId: "effects.lens"
categorySlug: "effects-lens"
categoryTitle: "Lens"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/effects/lens.ts#L54"
---

# chromaticFan

Split the child into red, green and blue copies pushed apart along one direction.

```ts
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

```ts
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 `green` at 0 to hold the layer's outline in place.

## See also

- [`gatherStack`](/docs/primitives/effects-blurs/gatherstack) — Assemble an effect from one sampling stage and an ordered list of overlay stages.
- [`spectralLens`](/docs/primitives/effects-lens/spectrallens) — Fan the child out into many color-shifted copies through a warped lens, the spectral-lens look.

## Used by

[ChromaticAberration](/docs/components/chromaticaberration)