---
title: "splat3"
description: "One number copied into all three channels of a vec3."
group: "space"
groupTitle: "Shapes, frames & warps"
categoryId: "math"
categorySlug: "math"
categoryTitle: "Math"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/math.ts#L548"
---

# splat3

One number copied into all three channels of a vec3.

```ts
splat3(x: Val): Expr
```

Import `math` from `shaders/std` and use `math.splat3`.

The usual way to blend two colors by a single amount with `mix`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `x` | `Val` |  |

## Example

```ts
const rgb = mix(darkRgb, lightRgb, splat3(brightness))
```

## See also

- [`mix`](/docs/primitives/math/mix) — A blend from `a` to `b` by `t`, where 0 gives `a` and 1 gives `b`.
- [`vec3`](/docs/primitives/math/vec3) — A 3D vector from three values, often a color without alpha.

## Used by

[Aurora](/docs/components/aurora), [CarbonFiber](/docs/components/carbonfiber), [Chrome](/docs/components/chrome), [Crystal](/docs/components/crystal), [FlowingGradient](/docs/components/flowinggradient), [Frost](/docs/components/frost), [Hologram](/docs/components/hologram), [Holographic](/docs/components/holographic), [Irradiance](/docs/components/irradiance), [Nebula](/docs/components/nebula), [Obsidian](/docs/components/obsidian), [Plastic](/docs/components/plastic), [Prism](/docs/components/prism), [ReactionDiffusion](/docs/components/reactiondiffusion), [Sparkle](/docs/components/sparkle), [StudioBackground](/docs/components/studiobackground), [Water](/docs/components/water)