import Utils from '../utils/index.mjs';
import Color from '../color/index.mjs';

/* IMPORT */
/* MAIN */
//SOURCE: https://planetcalc.com/7779
const luminance = (color) => {
    const { r, g, b } = Color.parse(color);
    const luminance = .2126 * Utils.channel.toLinear(r) + .7152 * Utils.channel.toLinear(g) + .0722 * Utils.channel.toLinear(b);
    return Utils.lang.round(luminance);
};

export { luminance as default };
