---
title: "edgeGlowAccumColorFor"
description: "The fold step for one color space: adds one color's spots to the running state."
group: "effects"
groupTitle: "Filters & effects"
categoryId: "effects.edgeGlow"
categorySlug: "effects-edgeglow"
categoryTitle: "Edge glow"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/effects/edgeGlow.ts#L218"
---

# edgeGlowAccumColorFor

The fold step for one color space: adds one color's spots to the running state.

```ts
edgeGlowAccumColorFor(mode: number): TgpuFn<(st: WgslStruct<{ rgb: Vec3f; w: F32; ba: F32; ac: Vec3f; aa: F32; }>, color: Vec4f, sectors: Vec2f) => WgslStruct<{ rgb: Vec3f; w: F32; ba: F32; ac: Vec3f; aa: F32; }>>
```

Import `effects` from `shaders/std` and use `effects.edgeGlow.edgeGlowAccumColorFor`.

`mode` is the compile-time value of a `colorSpace` prop (see `transformColorSpace`); where colors overlap they mix in that space. The returned GPU function takes the state, a color and the pair from `orbitSpotsAccum`, and returns the new state. Call it once per color, then close with `edgeGlowCompose`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `mode` | `number` |  |

## Example

```ts
const accumColor = edgeGlowAccumColorFor(propValues.colorSpace as number)
state = call(accumColor, 'edgeGlowAccumColor', [state, uniforms.colorA, sectors])
```

> **Tip.** OKLCh keeps overlapping lights vivid; linear RGB muddies them.

## See also

- [`edgeGlowAccumZero`](/docs/primitives/effects-edgeglow/edgeglowaccumzero) — The empty state to start folding colors into.
- [`orbitSpotsAccum`](/docs/primitives/effects-edgeglow/orbitspotsaccum) — The spots of one color orbiting the band, as coverage at this pixel.
- [`edgeGlowCompose`](/docs/primitives/effects-edgeglow/edgeglowcompose) — The final color from the folded state, over a transparent background.

## Used by

[LightEdge](/docs/components/lightedge)