Skip to content

Latest commit

 

History

History

luminance-srgb

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

@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