veil function
How the backdrop dims one channel of what the canvas drew under it.
import { veil } from '@dioramajs/media/lightbox'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.
function veil(a: number, b: number): [gain: number, add: number]Parameters
| Name | Type | Description |
|---|---|---|
a | number | |
b | number |
Defined in packages/media/src/lightbox.ts.