Sha256: a9407d3eb20dc3a500e639f59991a46c1da768212a12920b15db00cfeaec70b3
Contents?: true
Size: 1.06 KB
Versions: 5
Compression:
Stored size: 1.06 KB
Contents
/* Compass YIQ Color Contrast https://github.com/easy-designs/yiq-color-contrast ========================================================================== */ @function yiq-is-light( $color, $threshold: $yiq-contrasted-threshold ) { $red: red($color); $green: green($color); $blue: blue($color); $yiq: (($red*299)+($green*587)+($blue*114))/1000; @if $yiq-debug { @debug $yiq, $threshold; } @return if($yiq >= $threshold, true, false); } @function yiq-contrast-color( $color, $dark: $yiq-contrasted-dark-default, $light: $yiq-contrasted-light-default, $threshold: $yiq-contrasted-threshold ) { @return if(yiq-is-light($color, $threshold), $yiq-contrasted-dark-default, $yiq-contrasted-light-default); } @mixin yiq-contrasted( $background-color, $dark: $yiq-contrasted-dark-default, $light: $yiq-contrasted-light-default, $threshold: $yiq-contrasted-threshold ) { background-color: $background-color; color: yiq-contrast-color($background-color, $dark, $light, $threshold); }
Version data entries
5 entries across 5 versions & 2 rubygems