pigment 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/pigment.rb +8 -1
  2. metadata +1 -1
data/lib/pigment.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Pigment
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
 
4
4
  class Color
5
5
 
@@ -42,10 +42,16 @@ module Pigment
42
42
  @color[3] = alpha if alpha.is_a?(Float) && (0.0..1.0).include?(alpha)
43
43
  end
44
44
 
45
+ # Returns an array with the rgb components
46
+ # @return [Array]
45
47
  def rgb
46
48
  @color[0, 3]
47
49
  end
48
50
 
51
+ def hsl
52
+ @hsl ? @hsl : to_hsl
53
+ end
54
+
49
55
  # Return specified color by its name from the named_colors hash.
50
56
  # @param [Symbol] name
51
57
  # @return [Color]
@@ -255,6 +261,7 @@ module Pigment
255
261
  h += 1 if h < 0
256
262
  h -= 1 if h > 1
257
263
  @hsl = [h, s, l]
264
+ @hsl
258
265
  end
259
266
 
260
267
  # 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.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: