Add light/dark color functions

This commit is contained in:
Jeremy Thomas
2019-10-13 10:10:13 +01:00
parent 46b3edf9fe
commit 5131f2ab04
2 changed files with 17 additions and 1 deletions

View File

@@ -65,3 +65,19 @@
@return rgba(#000, 0.7)
@else
@return #fff
@function findLightColor($color)
@if type-of($color) == 'color'
$l: 96%
@if lightness($color) > 96%
$l: lightness($color)
@return change-color($color, $lightness: $l)
@return $background
@function findDarkColor($color)
@if type-of($color) == 'color'
$l: 29%
@if lightness($color) < 29%
$l: lightness($color)
@return change-color($color, $lightness: $l)
@return $text-strong