# Warp

> Domain-warped fractal noise mapped to a color palette, as soft clouds, ridges, or marble.

Source: https://www.honestui.com/docs/shaders/warp

<ComponentPreview name="warp-demo" />

## Overview [#overview]

Warp layers fractal noise and then feeds the noise back into its own input, twice. The result folds into flowing, smoke-like shapes that move slowly over time. Each value maps onto `colors`, from the first color at the lowest value to the last at the highest.

Three patterns change the character of the field:

* **fbm** gives soft, cloud-like gradients.
* **Ridged** folds each noise layer into sharp creases, like terrain or veins.
* **Marble** bends diagonal bands through the warped field.

Use it for textured backgrounds, artwork panels, and loading surfaces. Ordered palettes, dark to light, give the clearest depth.

## Installation [#installation]

<CommandBlock commands="[&#x22;honestui&#x22;]" />

## Usage [#usage]

```tsx
import { Warp } from "honestui/shaders"

<div className="h-80 bg-[#2c3552]">
  <Warp
    className="size-full"
    colors={["#14161f", "#2c3552", "#6f7fa8", "#d9c8b4", "#f6efe6"]}
    pattern="fbm"
    warp={1}
  />
</div>
```

Each octave adds a layer of noise per warp pass, so lower `octaves` on large surfaces or low-power devices.

## Accessibility [#accessibility]

Warp is decorative and its canvas is hidden from assistive technology. Keep content in normal HTML; the field spans the full palette, so place text on a solid panel or check contrast against both ends of it.

The effect pauses while it is offscreen or the tab is hidden, and shows a still frame when the user prefers reduced motion. Without WebGL2 the container shows only its own background.

## API Reference [#api-reference]


  ### `colors`

type: `string[]` · default: `[&#x22;#14161f&#x22;, &#x22;#2c3552&#x22;, &#x22;#6f7fa8&#x22;, &#x22;#d9c8b4&#x22;, &#x22;#f6efe6&#x22;]`

Two to six hex colors from the lowest to the highest value.

  ### `pattern`

type: `&#x22;fbm&#x22; | &#x22;ridged&#x22; | &#x22;marble&#x22;` · default: `&#x22;fbm&#x22;`

Character of the noise.

  ### `scale`

type: `number` · default: `1`

Feature size. Higher values zoom out.

  ### `octaves`

type: `number` · default: `5`

Layers of detail, from 1 to 8.

  ### `warp`

type: `number` · default: `1`

How strongly the noise folds back on itself, from 0 to 2.

  ### `swirl`

type: `number` · default: `0.3`

Rotation between warp passes, from 0 to 1.

  ### `contrast`

type: `number` · default: `1.2`

Separation between the darkest and lightest colors.

  ### `speed`

type: `number` · default: `0.4`

Animation speed.

  ### `paused`

type: `boolean` · default: `false`

Renders a still frame instead of animating.

  ### `className`

type: `string`

Class for sizing and positioning the container.
