compass-yiq-color-contrast 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,10 +3,8 @@ $yiq-contrasted-light-default: #fff !default;
3
3
  $yiq-contrasted-threshold: 128 !default;
4
4
  $yiq-debug: false !default;
5
5
 
6
- @function yiq-contrast-color(
6
+ @function yiq-is-light(
7
7
  $color,
8
- $dark: $yiq-contrasted-dark-default,
9
- $light: $yiq-contrasted-light-default,
10
8
  $threshold: $yiq-contrasted-threshold
11
9
  ) {
12
10
  $red: red($color);
@@ -17,7 +15,16 @@ $yiq-debug: false !default;
17
15
 
18
16
  @if $yiq-debug { @debug $yiq, $threshold; }
19
17
 
20
- @return if($yiq >= $threshold, $dark, $light);
18
+ @return if($yiq >= $threshold, true, false);
19
+ }
20
+
21
+ @function yiq-contrast-color(
22
+ $color,
23
+ $dark: $yiq-contrasted-dark-default,
24
+ $light: $yiq-contrasted-light-default,
25
+ $threshold: $yiq-contrasted-threshold
26
+ ) {
27
+ @return if(yiq-is-light($color, $threshold), $yiq-contrasted-dark-default, $yiq-contrasted-light-default);
21
28
  }
22
29
 
23
30
  @mixin yiq-contrasted(
@@ -28,4 +35,4 @@ $yiq-debug: false !default;
28
35
  ) {
29
36
  background-color: $background-color;
30
37
  color: yiq-contrast-color($background-color, $dark, $light, $threshold);
31
- }
38
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compass-yiq-color-contrast
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-27 00:00:00.000000000 Z
12
+ date: 2013-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sass