---
title: "dist.spiral"
description: "A turning spiral stripe: 0 on the background, 1 on the stroke."
group: "paint"
groupTitle: "Painting"
categoryId: "paint"
categorySlug: "paint"
categoryTitle: "Fields, palettes & ramps"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/paint/fields.ts#L348"
---

# dist.spiral

A turning spiral stripe: 0 on the background, 1 on the stroke.

```ts
dist.spiral(slots: {center: PropRef; scale: FieldScalar; width: FieldScalar; falloff: FieldScalar; softness: FieldScalar}): Field
```

Import `paint` from `shaders/std` and use `paint.dist.spiral`.

It spins on the layer's clock, so declare `animatedTime: {speed: 'speed'}`. `scale` sets how many turns fit, `width` (0–2) the stroke thickness, `falloff` (0–1) thins the stroke away from the center, `softness` (0–1) blurs its edge. Unlike the other distance fields this one is already 0–1, so pair it with a palette of background and stroke colors.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `slots` | `{center: PropRef; scale: FieldScalar; width: FieldScalar; falloff: FieldScalar; softness: FieldScalar}` |  |

## Example

```ts
paint: rampOver(dist.spiral({center: p('center'), scale: p('scale'), width: p('strokeWidth'), falloff: p('strokeFalloff'), softness: p('softness')}), pair(p('background'), p('stroke'), p('colorSpace')))
```

## Used by

[Spiral](/docs/components/spiral)