# Dither Gradient

A dusk sky dithered in your exact palette.

Source: https://gradients.sh/docs/pro/dither-gradient

## Installation

```bash
npx gradients.sh add dither-gradient
```

Pro: this needs a Pro account. The first run on a computer prints a login link for the user to approve, then you run it again. Details: https://gradients.sh/docs/pro.md.

## Usage

```tsx
import { DitherGradient } from "@/components/dither-gradient";

<DitherGradient className="h-[560px]">{children}</DitherGradient>;
```

It fills its box, so give it a height. Children render on top.

## Props

| Prop         | Type                                 | Default  | Description                                                                                                                       |
| ------------ | ------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `palette`    | `"dusk"`, `"ultramarine"`, `"ember"` | `"dusk"` | One of the curated palettes.                                                                                                      |
| `appearance` | `"auto"`, `"dark"`, `"light"`        | `"auto"` | Which version of the palette to use. `auto` follows a `dark` or `light` class (or `data-theme`) on `<html>`, then the OS setting. |
| `colors`     | `string[]`                           | palette  | 2 to 6 CSS colours, `var(--x)` included. Replaces the palette's colours.                                                          |
| `background` | `string`                             | palette  | Replaces the palette's background.                                                                                                |
| `pixelSize`  | `number`                             | `5`      | 1 to 32. Size of one cell in device pixels.                                                                                       |
| `softness`   | `number`                             | `0.45`   | 0 to 1. Width of the dithered seams between colours.                                                                              |
| `bands`      | `number`                             | `0.45`   | 0 to 1. How much the cloud bands bend.                                                                                            |
| `grain`      | `number`                             | `0`      | 0 to 1. Film grain.                                                                                                               |
| `speed`      | `number`                             | `0.5`    | 0 to 2. How fast it moves; 0 holds a still frame.                                                                                 |
| `params`     | `Partial<GradientParams>`            | none     | Any other engine param, applied last.                                                                                             |
| `className`  | `string`                             | none     | Classes for the outer box. Give it a size, for example `h-[560px]`.                                                               |
| `style`      | `CSSProperties`                      | none     | Inline styles for the outer box.                                                                                                  |
| `children`   | `ReactNode`                          | none     | Content drawn above the background.                                                                                               |
