compass-photoshop-gradient-overlay 1.1.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,26 +1,33 @@
1
1
  @import "photoshop-blend-modes";
2
2
 
3
- // Photoshop Gradient Overlay
3
+ $gradient-overlay-blend-mode: normal !default;
4
+ $gradient-overlay-opacity: 100% !default;
5
+ $gradient-overlay-angle: 90deg !default;
6
+ $gradient-overlay-scale: 100% !default;
7
+ $gradient-overlay-color-stops: (#000 0%, #fff 100%) !default;
8
+
9
+ // Compass Extension Installation
4
10
  // --------------------------
5
11
  @function photoshop-gradient-overlay(
6
- $bg-color,
7
- $blend: normal,
8
- $opacity: 100%,
9
- $angle: 90deg,
10
- $scale: 100%,
11
- $gradient-colors: (#000, #fff),
12
- $gradient-stops: (0%, 100%)
13
- ) {
14
-
15
- $css-angle: convert-angle($angle);
16
- $color-stops: ();
17
-
18
- @for $i from 1 through length($gradient-colors) {
19
- $blended-color: photoshop-blend($blend, $bg-color, nth($gradient-colors, $i), percentage-to-decimal($opacity));
20
- $stop: join($blended-color, stop-scale(nth($gradient-stops, $i), $scale), space);
21
- $color-stops: append($color-stops, $stop, comma);
12
+ $bg-color,
13
+ $blend: $gradient-overlay-blend-mode,
14
+ $opacity: $gradient-overlay-opacity,
15
+ $angle: $gradient-overlay-angle,
16
+ $scale: $gradient-overlay-scale,
17
+ $color-stops: $gradient-overlay-color-stops
18
+ ) {
19
+
20
+ // 0deg = north in CSS; 0deg = east in Photoshop.
21
+ $css-angle: $angle - 90deg;
22
+ $css-color-stops: ();
23
+
24
+ @for $i from 1 through length($color-stops) {
25
+ $blended-color: photoshop-blend($blend, $bg-color, nth( nth( $color-stops, $i ), 1 ), percentage-to-decimal($opacity));
26
+ $stop: join( $blended-color, stop-scale( nth( nth( $color-stops, $i ), 2 ), $scale ), space );
27
+ $css-color-stops: append($css-color-stops, $stop, comma);
22
28
  }
23
- @return linear-gradient($css-angle, $color-stops);
29
+
30
+ @return linear-gradient($css-angle, $css-color-stops);
24
31
  }
25
32
 
26
33
  // Adjust the color-stops based on the scale value
@@ -37,20 +44,4 @@
37
44
  $percentage: $percentage/100%;
38
45
  }
39
46
  @return $percentage;
40
- }
41
-
42
- // Attempt to convert a Photoshop angle to a CSS keyword.
43
- // If a valid keyword isn't available, convert to a CSS angle (0deg = north in CSS; east in Photoshop)
44
- @function convert-angle($angle) {
45
- @if $angle == 0 {
46
- @return left;
47
- } @else if $angle == 90 {
48
- @return bottom;
49
- } @else if $angle == 180 {
50
- @return right;
51
- } @else if $angle == -90 {
52
- @return top;
53
- } @else {
54
- @return $angle - 90deg;
55
- }
56
47
  }
@@ -73,20 +73,20 @@ body {
73
73
 
74
74
  .gradient--stops--3{
75
75
  @extend %gradient-example;
76
- @include background-image(photoshop-gradient-overlay($bg-color: #fff, $gradient-colors: ( red, green, blue ), $gradient-stops: ( 0%, 50%, 100% )));
76
+ @include background-image(photoshop-gradient-overlay($bg-color: #fff, $color-stops: ( red 0%, green 50%, blue 100% )));
77
77
  }
78
78
 
79
79
  .gradient--stops--4{
80
80
  @extend %gradient-example;
81
- @include background-image(photoshop-gradient-overlay($bg-color: #fff, $gradient-colors: ( red, yellow, green, blue ), $gradient-stops: ( 0%, 33.3333%, 66.6666%, 100% )));
81
+ @include background-image(photoshop-gradient-overlay($bg-color: #fff, $color-stops: ( red 0%, yellow 33.3333%, green 66.6666%, blue 100% )));
82
82
  }
83
83
 
84
84
  .gradient--stops--5{
85
85
  @extend %gradient-example;
86
- @include background-image(photoshop-gradient-overlay($bg-color: #fff, $gradient-colors: ( red, orange, yellow, green, blue ), $gradient-stops: ( 0%, 25%, 50%, 75%, 100% )));
86
+ @include background-image(photoshop-gradient-overlay($bg-color: #fff, $color-stops: ( red 0%, orange 25%, yellow 50%, green 75%, blue 100% )));
87
87
  }
88
88
 
89
89
  .gradient--stops--6{
90
90
  @extend %gradient-example;
91
- @include background-image(photoshop-gradient-overlay($bg-color: #fff, $gradient-colors: ( red, orange, yellow, green, blue, violet ), $gradient-stops: ( 0%, 20%, 40%, 60%, 80%, 100% )));
91
+ @include background-image(photoshop-gradient-overlay($bg-color: #fff, $color-stops: ( red 0%, orange 20%, yellow 40%, green 60%, blue 80%, violet 100% )));
92
92
  }
metadata CHANGED
@@ -1,60 +1,56 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: compass-photoshop-gradient-overlay
3
- version: !ruby/object:Gem::Version
4
- hash: 23
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 1
9
- - 2
10
- version: 1.1.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Tim Hettler
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2013-05-24 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2013-10-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: sass
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
32
22
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: compass
36
23
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: compass
32
+ requirement: !ruby/object:Gem::Requirement
38
33
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0.13'
46
38
  type: :runtime
47
- version_requirements: *id002
48
- description: A compass extension to translate between Photoshop gradient overlays and CSS linear-gradients
49
- email:
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0.13'
46
+ description: A compass extension to translate between Photoshop gradient overlays
47
+ and CSS linear-gradients
48
+ email:
50
49
  - me+github@timhettler.com
51
50
  executables: []
52
-
53
51
  extensions: []
54
-
55
52
  extra_rdoc_files: []
56
-
57
- files:
53
+ files:
58
54
  - lib/compass-photoshop-gradient-overlay.rb
59
55
  - stylesheets/_photoshop-blend-modes.scss
60
56
  - stylesheets/_photoshop-gradient-overlay.scss
@@ -63,38 +59,27 @@ files:
63
59
  - templates/example/manifest.rb
64
60
  homepage: https://github.com/timhettler/compass-photoshop-gradient-overlay
65
61
  licenses: []
66
-
67
62
  post_install_message:
68
63
  rdoc_options: []
69
-
70
- require_paths:
64
+ require_paths:
71
65
  - lib
72
- required_ruby_version: !ruby/object:Gem::Requirement
66
+ required_ruby_version: !ruby/object:Gem::Requirement
73
67
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 3
78
- segments:
79
- - 0
80
- version: "0"
81
- required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
73
  none: false
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- hash: 23
87
- segments:
88
- - 1
89
- - 3
90
- - 6
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
91
77
  version: 1.3.6
92
78
  requirements: []
93
-
94
79
  rubyforge_project:
95
- rubygems_version: 1.8.25
80
+ rubygems_version: 1.8.23
96
81
  signing_key:
97
82
  specification_version: 3
98
- summary: A compass extension to translate between Photoshop gradient overlays and CSS linear-gradients
83
+ summary: A compass extension to translate between Photoshop gradient overlays and
84
+ CSS linear-gradients
99
85
  test_files: []
100
-