Skip to content

Commit

Permalink
using theirs.
Browse files Browse the repository at this point in the history
  • Loading branch information
timhettler committed Oct 31, 2013
2 parents 1993422 + 8ebd1d9 commit 0c146d2
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ $yiq-contrasted-light-default: #fff !default;
$yiq-contrasted-threshold: 128 !default;
$yiq-debug: false !default;

@function yiq-contrast-color(
@function yiq-is-light(
$color,
$dark: $yiq-contrasted-dark-default,
$light: $yiq-contrasted-light-default,
$threshold: $yiq-contrasted-threshold
) {
$red: red($color);
Expand All @@ -17,7 +15,16 @@ $yiq-debug: false !default;

@if $yiq-debug { @debug $yiq, $threshold; }

@return if($yiq >= $threshold, $dark, $light);
@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(
Expand All @@ -28,4 +35,4 @@ $yiq-debug: false !default;
) {
background-color: $background-color;
color: yiq-contrast-color($background-color, $dark, $light, $threshold);
}
}

0 comments on commit 0c146d2

Please sign in to comment.