Mercurial > nebulaweb3
comparison default/assets/scss/vendors/bourbon/validators/_is-light.scss @ 0:1d038bc9b3d2 default tip
Up:default
author | Liny <dev@neowd.com> |
---|---|
date | Sat, 31 May 2025 09:21:51 +0800 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1d038bc9b3d2 |
---|---|
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 } |