# saturate

> Applies a `filter: saturate(...)` to the element itself, where `0` is fully desaturated and values above `1` oversaturate.

```ts
import { saturate } from "@sdxc/u/effects";
```

Applies a `filter: saturate(...)` to the element itself, where `0` is fully
desaturated and values above `1` oversaturate. Writes into the shared
composite `filter` declaration, so it stacks with every other filter utility.

## Quick reference

Every documented call, beside the CSS it emits.

| Call | CSS |
| --- | --- |
| `u.saturate(1.5)` | `css({ "--ui-filter-saturate": "1.5", filter: "... saturate(var(--ui-filter-saturate, 1)) ..." })` |

## Examples

### Basic example

Use `saturate(n)` to mute an element's colors below `1` or intensify them above `1`:

```tsx
<div mix={[...]}>
	<div mix={[...]}>
		<img mix={[saturate(0.5), ...]} src={...} alt="" />
		<span mix={[...]}>saturate(0.5)</span>
	</div>
	<div mix={[...]}>
		<img mix={[saturate(1.5), ...]} src={...} alt="" />
		<span mix={[...]}>saturate(1.5)</span>
	</div>
	<div mix={[...]}>
		<img mix={[saturate(2), ...]} src={...} alt="" />
		<span mix={[...]}>saturate(2)</span>
	</div>
</div>
```

## Using a custom value

Every scale argument also takes a raw CSS value, which passes through untouched.

```ts
u.saturate("2.75rem")
```

## Applying on a state

Wrap the call in a state utility to scope it to one selector.

```ts
u.hover(u.saturate(1.5))
```

## Responsive design

Wrap the call in a container query to scope it to one width.

```ts
u.at("md", u.saturate(1.5))
```

## Signature

```ts
u.saturate(value?: number | (string & {}))
```
