0
|
1 @charset "UTF-8";
|
|
2
|
|
3 /// Programatically determines whether a color is light or dark.
|
|
4 ///
|
|
5 /// @link http://goo.gl/Dil4Y9
|
|
6 ///
|
|
7 /// @argument {color (hex)} $hex-color
|
|
8 ///
|
|
9 /// @return {boolean}
|
|
10 ///
|
|
11 /// @example scss
|
|
12 /// is-light($color)
|
|
13 ///
|
|
14 /// @access private
|
|
15
|
|
16 @function _is-light($hex-color) {
|
|
17 $-local-red: red(rgba($hex-color, 1));
|
|
18 $-local-green: green(rgba($hex-color, 1));
|
|
19 $-local-blue: blue(rgba($hex-color, 1));
|
|
20 $-local-lightness: ($-local-red * 0.2126 + $-local-green * 0.7152 + $-local-blue * 0.0722) / 255;
|
|
21
|
|
22 @return $-local-lightness > 0.6;
|
|
23 }
|