function srgbLuminance({r, g, b}) {
  // from tinycolor
  // https://github.com/bgrins/TinyColor/blob/master/tinycolor.js#L75
  // http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
  let RsRGB, GsRGB, BsRGB, R, G, B;
  RsRGB = r / 255;
  GsRGB = g / 255;
  BsRGB = b / 255;

  if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
  if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
  if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
  return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
}
/**
 * Calculates the luminance of the given RGB color.
 */
Calculates the luminance of the given RGB color.
Calculates the luminance of the given RGB color .
function srgbLuminance({r, g, b}) {
  let RsRGB, GsRGB, BsRGB, R, G, B;
  RsRGB = r / 255;
  GsRGB = g / 255;
  BsRGB = b / 255;
  if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
  if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
  if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
  return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
}
function srgbLuminance ( { r , g , b } ) { let RsRGB , GsRGB , BsRGB , R , G , B ; RsRGB = r / 255 ; GsRGB = g / 255 ; BsRGB = b / 255 ; if ( RsRGB <= 0.03928 ) { R = RsRGB / 12.92 ; } else { R = Math . pow ( ( ( RsRGB + 0.055 ) / 1.055 ) , 2.4 ) ; } if ( GsRGB <= 0.03928 ) { G = GsRGB / 12.92 ; } else { G = Math . pow ( ( ( GsRGB + 0.055 ) / 1.055 ) , 2.4 ) ; } if ( BsRGB <= 0.03928 ) { B = BsRGB / 12.92 ; } else { B = Math . pow ( ( ( BsRGB + 0.055 ) / 1.055 ) , 2.4 ) ; } return ( 0.2126 * R ) + ( 0.7152 * G ) + ( 0.0722 * B ) ; }
Calculates the luminance of the given RGB color.
Calculates the luminance of the given RGB color .
// from tinycolor // https://github.com/bgrins/TinyColor/blob/master/tinycolor.js#L75 // http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef