Sha256: 37d91e89293967a05c14cfa9fb42a4f01970081d10ec88b1fb9cfc2b73160d8f
Contents?: true
Size: 1.91 KB
Versions: 3
Compression:
Stored size: 1.91 KB
Contents
@function color($value) @if type-of($value) == color @return true @else @return null @function color_list($values) @if list($values) @each $value in $values @if color($value) @return true @else @return null @else @return null @function optional_color_list($values) @if color($values) @return true @else if color_list($values) @return true @else @return null @function luma($color) $r: red($color) $g: green($color) $b: blue($color) @return (0.299 * $r + 0.587 * $g + 0.114 * $b)/2.55 $ruma-threshold: 100 / pi() !default @function luma_contrast($color-1, $color-2: null) @if $color-2 @if abs(luma($color-1) - luma($color-2)) > $ruma-threshold @return true @else @return null @else @return if(luma($color-1) < 51, dark, bright) @function luma_value($color-1, $color-2: null) @if $color-2 @return abs(luma($color-1) - luma($color-2)) @else @return luma($color-1) @function luma_which($color) @return if(luma($color) < 51, dark, bright) @function luma_bright($color) @if luma($color) < 51 @return null @else @return true @function luma_dark($color) @if luma($color) < 51 @return true @else @return null @function luma_contrast_color($color) $luma-contrast-bright-color: #000000 !default $luma-contrast-dark-color: #ffffff !default @if luma_which($color) == bright @return $luma-contrast-bright-color @else @return $luma-contrast-dark-color @function luma_add_contrast($background-color, $candidate-color) @if luma_contrast($background-color, $candidate-color) @return $candidate-color @else @if luma_dark($background-color) @return tint($candidate-color, reverse(percentage(luma_value($background-color, $candidate-color)*0.01))/1.618) @else @return shade($candidate-color, reverse(percentage(luma_value($background-color, $candidate-color)*0.01))/1.618)
Version data entries
3 entries across 3 versions & 2 rubygems