---
title: "dist.diamond"
description: "A diamond-shaped gradient spreading out from a center."
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#L326"
---

# dist.diamond

A diamond-shaped gradient spreading out from a center.

```ts
dist.diamond(slots: {center: PropRef; size: FieldScalar; rotation: FieldScalar; roundness: FieldScalar}): Field
```

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

0 at `center`, 1 at `size` (a fraction of the canvas height). `roundness` 0 is a sharp diamond and 1 is a square. `rotation` in degrees tilts it.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `slots` | `{center: PropRef; size: FieldScalar; rotation: FieldScalar; roundness: FieldScalar}` |  |

## Example

```ts
paint: rampOver(rings(dist.diamond({center: p('center'), size: p('size'), rotation: p('rotation'), roundness: p('roundness')}), p('repeat')), stops(p('colorSpace')))
```

## See also

- [`rings`](/docs/primitives/paint/rings) — Repeats a field as concentric bands.

## Used by

[DiamondGradient](/docs/components/diamondgradient)