diff options
Diffstat (limited to 'debian/missing-sources/bourbon/app/assets/stylesheets/functions/_is-light.scss')
-rw-r--r-- | debian/missing-sources/bourbon/app/assets/stylesheets/functions/_is-light.scss | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/debian/missing-sources/bourbon/app/assets/stylesheets/functions/_is-light.scss b/debian/missing-sources/bourbon/app/assets/stylesheets/functions/_is-light.scss new file mode 100644 index 0000000..0d72867 --- /dev/null +++ b/debian/missing-sources/bourbon/app/assets/stylesheets/functions/_is-light.scss @@ -0,0 +1,26 @@ +@charset "UTF-8"; + +/// Programatically determines whether a color is light or dark. +/// +/// @link http://robots.thoughtbot.com/closer-look-color-lightness +/// +/// @param {Color (Hex)} $color +/// +/// @example scss - Usage +/// is-light($color) +/// +/// @return {Bool} + +@function is-light($hex-color) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `is-light` is deprecated and will be " + + "removed in 5.0.0."; + } + + $-local-red: red(rgba($hex-color, 1)); + $-local-green: green(rgba($hex-color, 1)); + $-local-blue: blue(rgba($hex-color, 1)); + $-local-lightness: ($-local-red * 0.2126 + $-local-green * 0.7152 + $-local-blue * 0.0722) / 255; + + @return $-local-lightness > 0.6; +} |