pigment 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/colors.rb +1 -1
  2. data/lib/pigment.rb +7 -1
  3. metadata +1 -1
data/lib/colors.rb CHANGED
@@ -256,7 +256,7 @@ module Pigment
256
256
  self[:EgyptianBlue] = '#1034A6'
257
257
  self[:ElectricBlue] = '#7DF9FF'
258
258
  self[:ElectricCrimson] = '#FF003F'
259
- self[:ElectricGreen, :GreenX11, :Lime, :LimeWeb] = '#00FF00'
259
+ self[:ElectricGreen, :Green, :GreenX11, :Lime, :LimeWeb] = '#00FF00'
260
260
  self[:ElectricIndigo] = '#6F00FF'
261
261
  self[:ElectricLime, :FluorescentYellow, :FrenchLime] = '#CCFF00'
262
262
  self[:ElectricPurple] = '#BF00FF'
data/lib/pigment.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Pigment
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
 
4
4
  class Color
5
5
 
@@ -249,6 +249,10 @@ module Pigment
249
249
  to_ints(with_alpha).map { |v| '%02x' % v }.join
250
250
  end
251
251
 
252
+ def to_s
253
+ "Color(r=#{r}, g=#{g}, b=#{b}, a=#{a}#{", [h=#{h}, s=#{s}, l=#{l}]" if @hsl})"
254
+ end
255
+
252
256
  alias_method :inv, :inverse
253
257
  alias_method :invert, :inverse
254
258
  alias_method :complementary, :inverse
@@ -257,6 +261,8 @@ module Pigment
257
261
  alias_method :green, :g
258
262
  alias_method :blue, :b
259
263
  alias_method :alpha, :a
264
+ alias_method :to_a, :to_floats
265
+ alias_method :to_ary, :to_floats
260
266
  alias_method :to_f, :to_floats
261
267
  end
262
268
  end
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.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: