@fantasy-color/luminance-rgb
v2.1.0
Published
For a given RGB color (coded as an RGB object), return its relative luminance
Downloads
23
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