3 /// Programatically determines the lightness of a color.
5 /// @argument {color (hex)} $hex-color
7 /// @return {number (0-1)}
10 /// _lightness($color)
14 @function _lightness($hex-color) {
15 $-local-red-raw: red(rgba($hex-color, 1));
16 $-local-green-raw: green(rgba($hex-color, 1));
17 $-local-blue-raw: blue(rgba($hex-color, 1));
19 $-local-red: _gamma($-local-red-raw / 255);
20 $-local-green: _gamma($-local-green-raw / 255);
21 $-local-blue: _gamma($-local-blue-raw / 255);
23 @return $-local-red * 0.2126 + $-local-green * 0.7152 + $-local-blue * 0.0722;