]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
feature/yiq function, add parameters, with default values. (#26917)
authorAndrey <lukin.andrej@gmail.com>
Sun, 21 Oct 2018 07:33:53 +0000 (10:33 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Sun, 21 Oct 2018 07:33:53 +0000 (10:33 +0300)
scss/_functions.scss

index ab2fd0ba34aa970e1de878edfcc5fcf1b5fb2f11..77b8c8f1042cf3462259d64249523fc049193f95 100644 (file)
@@ -49,7 +49,7 @@
 }
 
 // Color contrast
-@function color-yiq($color) {
+@function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) {
   $r: red($color);
   $g: green($color);
   $b: blue($color);
@@ -57,9 +57,9 @@
   $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
 
   @if ($yiq >= $yiq-contrasted-threshold) {
-    @return $yiq-text-dark;
+    @return $dark;
   } @else {
-    @return $yiq-text-light;
+    @return $light;
   }
 }