# veil

function in `@dioramajs/media/lightbox`

```ts
import { veil } from '@dioramajs/media/lightbox'
```

How the backdrop dims one channel of what the canvas drew under it. The browser lays the
canvas over the page in sRGB, so there the page turns into `(1 - a) * page + a * b` for a
backdrop channel `b` (sRGB) at opacity `a`. The canvas blends in linear light, where a pass can
only scale and add: a channel `c` turns into `c * gain + add`, the line through that sRGB mix
at two tones. The darkest tones stay off by at most 4 levels of 255 at opacity 0.92, 13 at 0.5.

```ts
function veil(a: number, b: number): [gain: number, add: number]
```

| Parameter | Type | Description |
| --- | --- | --- |
| `a` | `number` |  |
| `b` | `number` |  |

Defined in [packages/media/src/lightbox.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/media/src/lightbox.ts#L118).
