Sha256: a0971617a8d23dc03976790a4c534f0251b55190138281065053efb1e8e21655

Contents?: true

Size: 727 Bytes

Versions: 38

Compression:

Stored size: 727 Bytes

Contents

@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;
}

Version data entries

38 entries across 38 versions & 6 rubygems

Version Path
cortex-0.1.3 spec/dummy/node_modules/bourbon/app/assets/stylesheets/functions/_is-light.scss
english_tea-0.6.2 vendor/assets/stylesheets/bourbon/functions/_is-light.scss
english_tea-0.6.1 vendor/assets/stylesheets/bourbon/functions/_is-light.scss
english_tea-0.6.0 vendor/assets/stylesheets/bourbon/functions/_is-light.scss
english_tea-0.5.3 vendor/assets/stylesheets/bourbon/functions/_is-light.scss
english_tea-0.5.2 vendor/assets/stylesheets/bourbon/functions/_is-light.scss
english_tea-0.5.1 vendor/assets/stylesheets/bourbon/functions/_is-light.scss
english_tea-0.5.0 vendor/assets/stylesheets/bourbon/functions/_is-light.scss
english_tea-0.4.0 vendor/assets/stylesheets/bourbon/functions/_is-light.scss
english_tea-0.3.0 vendor/assets/stylesheets/bourbon/functions/_is-light.scss
wayfarer-jruby-0.0.3 docs/_sass/vendor/bourbon/functions/_is-light.scss
wayfarer-0.0.3 docs/_sass/vendor/bourbon/functions/_is-light.scss
wayfarer-jruby-0.0.2 docs/_sass/vendor/bourbon/functions/_is-light.scss
wayfarer-jruby-0.0.1 docs/_sass/vendor/bourbon/functions/_is-light.scss
bourbon-4.3.4 app/assets/stylesheets/functions/_is-light.scss
dta_rapid-0.3.5 _sass/vendor/bourbon/functions/_is-light.scss
dta_rapid-0.3.4 _sass/vendor/bourbon/functions/_is-light.scss
dta_rapid-0.3.3 _sass/vendor/bourbon/functions/_is-light.scss
dta_rapid-0.3.2 _sass/vendor/bourbon/functions/_is-light.scss
dta_rapid-0.3.1 _sass/vendor/bourbon/functions/_is-light.scss