Reference · Backgrounds for a bracket
luminancefunction
How light a colour is, from 0 (black) to 1 (white), as the WCAG contrast rules measure it.
Import it
import { luminance } from "@johnmorrisdotca/taisen-brackets/backgrounds";
Definition
function luminance(c: Parameters<typeof shared.luminance>[0]): number
Parameters
| Name | Type | Description |
|---|---|---|
c | Rgb | The red, green and blue, 0 to 255. |
Returns
number
The relative luminance.
Examples
import { luminance } from "@johnmorrisdotca/taisen-brackets/backgrounds";
console.log(luminance([255, 255, 255]), luminance([0, 0, 0]));1 0What it prints (run when this page was built)