Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

veil function

How the backdrop dims one channel of what the canvas drew under it.

View as Markdown
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

NameTypeDescription
anumber
bnumber

Defined in packages/media/src/lightbox.ts.