npm install relative-luminance
Calculate the relative luminance of an RGB triplet color.
Note that as of 1.0.0, this module doesn't directly export a function if you're using
CommonJS: use the
default export, like:
var luminance = default;
Table of Contents
Given a 3-element array of R, G, B varying from 0 to 255, return the luminance as a number from 0 to 1.
var luminance = ;var black_lum = ; // 0
Returns number luminance, between 0 and 1