pigment 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/pigment.rb +5 -3
  2. metadata +1 -1
data/lib/pigment.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Pigment
2
- VERSION = '0.1.3'
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
- @hsl ? @hsl : to_hsl
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
- @hsl
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.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pigment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: