pigment 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pigment.rb +5 -3
- metadata +1 -1
data/lib/pigment.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Pigment
|
2
|
-
VERSION = '0.1.
|
2
|
+
VERSION = '0.1.4'
|
3
3
|
|
4
4
|
class Color
|
5
5
|
|
@@ -49,7 +49,8 @@ module Pigment
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def hsl
|
52
|
-
|
52
|
+
to_hsl
|
53
|
+
@hsl
|
53
54
|
end
|
54
55
|
|
55
56
|
# Return specified color by its name from the named_colors hash.
|
@@ -252,6 +253,7 @@ module Pigment
|
|
252
253
|
h = if r == max
|
253
254
|
h = ((g - b) / delta) / 6.0
|
254
255
|
h += 1.0 if g < b
|
256
|
+
h
|
255
257
|
elsif g == max
|
256
258
|
((b - r) / delta) / 6.0 + (1.0 / 3.0)
|
257
259
|
elsif b == max
|
@@ -261,7 +263,7 @@ module Pigment
|
|
261
263
|
h += 1 if h < 0
|
262
264
|
h -= 1 if h > 1
|
263
265
|
@hsl = [h, s, l]
|
264
|
-
|
266
|
+
self
|
265
267
|
end
|
266
268
|
|
267
269
|
# Returns an array of the color components. Alpha value is passed as well if with_alpha is set to true.
|