@fantasy-color/luminance-srgb
v2.1.0
Published
For a given sRGB color (coded as an RGB object), return its relative luminance
Downloads
19
Keywords
Readme
@fantasy-color/luminance-srgb
Calculate the relative luminance of an RGB
color, coded as sRGB
type luminanceSrgb = (color: RGB) => number
Example usage:
import luminanceSrgb from '@fantasy-color/luminance-srgb'
luminanceSrgb({
red: 1,
green: 0.27,
blue: 0.2
})
// > 0.420144