---
title: "mixOf"
description: "A straight blend from one value to another by an amount from 0 to 1."
group: "paint"
groupTitle: "Painting"
categoryId: "patterns"
categorySlug: "patterns"
categoryTitle: "Patterns & tiling"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/paint/patterns.ts#L333"
---

# mixOf

A straight blend from one value to another by an amount from 0 to 1.

```ts
mixOf(from: PaintSlot, to: PaintSlot, amount: PaintSlot): PatternPaint
```

Import `patterns` from `shaders/std` and use `patterns.mixOf`.

Works on colors, RGB and single numbers alike, channel by channel with no color-space handling. For a color mix in a chosen color space use `strokeOver`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `from` | `PaintSlot` |  |
| `to` | `PaintSlot` |  |
| `amount` | `PaintSlot` |  |

## Example

```ts
mixOf(alphaOf(p('colorA')), alphaOf(p('colorB')), bands)
```

## See also

- [`strokeOver`](/docs/primitives/patterns/strokeover) — Two colors mixed through a mask: `fill` where the mask is 0, `stroke` where it is 1.
- [`times`](/docs/primitives/patterns/times) — The product of two values: a mask scaled by a prop, an RGB dimmed by a shade, two masks combined.

## Used by

[Chevron](/docs/components/chevron), [IsometricCubes](/docs/components/isometriccubes)