Sha256: a35b8f442295d53b5caf0c8b0d96e61379e2960e958085bdd9dd27fc9f63fbd2
Contents?: true
Size: 1.19 KB
Versions: 9
Compression:
Stored size: 1.19 KB
Contents
// This file is here to emulate the less #contrast function // TODO: this may be useful for the inverse theme, but if not, remove (it is unused after the removal of fullpalette) // contrast-color and brightness borrowed from compass // Copyright (c) 2009-2014 Christopher M. Eppstein // Complies with license: https://github.com/Compass/compass/blob/stable/LICENSE.markdown @function contrast-color($color, $dark: $contrasted-dark-default, $light: $contrasted-light-default, $threshold: null) { @if $threshold { // Deprecated in Compass 0.13 @warn "The $threshold argment to contrast-color is no longer needed and will be removed in the next release."; } @if $color == null { @return null; } @else { $color-brightness: brightness($color); $dark-text-brightness: brightness($dark); $light-text-brightness: brightness($light); @return if(abs($color-brightness - $light-text-brightness) > abs($color-brightness - $dark-text-brightness), $light, $dark); } } @function brightness($color) { @if type-of($color) == color { @return (red($color) * 0.299 + green($color) * 0.587 + blue($color) * 0.114) / 255 * 100%; } @else { @return unquote("brightness(#{$color})"); } }
Version data entries
9 entries across 9 versions & 2 rubygems