colorable 0.0.6 → 0.0.7

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -17
  3. data/lib/colorable/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac1460c553c9c37bf02b22212f6c8ed45851c6be
4
- data.tar.gz: 977374a82095b9f15119c9a8d228fb09d33301a1
3
+ metadata.gz: 4862f2760ecd40037e08051beda7ced338b1c589
4
+ data.tar.gz: f4882f6046fd30d8c098199ccc7681768013cff5
5
5
  SHA512:
6
- metadata.gz: 06b2ec7a55bc3c0ec0a7f81a9c18f77d2a4c7a2cf0ec1bc0b6ed79c33c7c2a0062943c9ced3ad1a870c9b5d35c3de59910a438fc285ad858895f0e91d699389c
7
- data.tar.gz: ce55ca5b201452872d2c11d4d69a537ba65857588b5e1c8b76204b73c51c936328e4913563fe7d8180e057d766a69051a181a4a141d9cfabf6894f73ddfbe035
6
+ metadata.gz: 9142e066151a08d31ce9b57107d47d1f640432631267f70db272625eaade9bca54da1f7e750686666b1180f6b7e33cd28c4d7fe9bc4524a3c68cfd720226ce8c
7
+ data.tar.gz: bba5baf4843abe1c52112b3fc1ee78c4f09066b2b6fb28015ce456aee93cf19e5fc72f653d1693876ef23a44eac2d3262e1e55842cfa6c9bf12201474ba56519
data/README.md CHANGED
@@ -23,31 +23,31 @@ Create a color object:
23
23
  require "colorable"
24
24
 
25
25
  # Accept X11 color names
26
- c = Colorable::Color.new(:green)
27
- c # => rgb(0,255,0)
28
- c.name # => "Green"
29
- c.hsb # => [120, 100, 100]
30
- c.hex # => "#00FF00"
26
+ c = Colorable::Color.new(:green) #=> #<Colorable::Color:0x007fa449954ee0 @name="Green", @rgb=[0, 255, 0], @hex=nil, @hsb=nil, @esc=nil>
27
+ c.name #=> "Green"
28
+ c.hsb #=> [120, 100, 100]
29
+ c.hex #=> "#00FF00"
30
+ c.to_s #=> "rgb(0,255,0)"
31
31
 
32
32
  # or RGB
33
- c2 = Colorable::Color.new([240, 248, 255])
34
- c2 # => rgb(240,248,255)
35
- c2.name # => "Alice Blue"
36
- c2.rgb # => [240, 248, 255]
37
- c2.hsb # => [208, 6, 100]
38
- c2.hex # => "#F0F8FF"
33
+ c2 = Colorable::Color.new([240, 248, 255]) #=> #<Colorable::Color:0x007fa449a69c90 @name="Alice Blue", @rgb=[240, 248, 255], @hex=nil, @hsb=nil, @esc=nil>
34
+ c2.name #=> "Alice Blue"
35
+ c2.rgb #=> [240, 248, 255]
36
+ c2.hsb #=> [208, 6, 100]
37
+ c2.hex #=> "#F0F8FF"
38
+ c2.to_s #=> "rgb(240,248,255)"
39
39
 
40
40
  Create a colorset object:
41
41
 
42
42
  # Default colorset sequence is by its color name order.
43
- cs = Colorable::Colorset.new
44
- cs.at # => rgb(240,248,255)
45
- 10.times.map { cs.next.name } # => ["Antique White", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "Blanched Almond", "Blue", "Blue Violet"]
43
+ cs = Colorable::Colorset.new #=> #<Colorset 0/144 pos='Alice Blue:rgb(240,248,255)'>
44
+ cs.at #=> #<Colorable::Color:0x007fa448beb2b8 @name="Alice Blue", @rgb=[240, 248, 255], @hex=nil, @hsb=nil, @esc=nil>
45
+ 10.times.map { cs.next.name } #=> ["Antique White", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "Blanched Almond", "Blue", "Blue Violet"]
46
46
 
47
47
  # Using Colorset#[], the order of the sequence is specified.
48
- cs2 = Colorable::Colorset[:hsb]
49
- cs2.at # => rgb(0,0,0)
50
- 10.times.map { cs2.next.hsb } # => [[0, 0, 41], [0, 0, 50], [0, 0, 66], [0, 0, 75], [0, 0, 75], [0, 0, 83], [0, 0, 86], [0, 0, 96], [0, 0, 100], [0, 2, 100]]
48
+ cs2 = Colorable::Colorset[:hsb] #=> #<Colorset 0/144 pos='Black:rgb(0,0,0)'>
49
+ cs2.at #=> #<Colorable::Color:0x007fa448a913e0 @name="Black", @rgb=[0, 0, 0], @hex=nil, @hsb=[0, 0, 0], @esc=nil>
50
+ 10.times.map { cs2.next.hsb } #=> [[0, 0, 41], [0, 0, 50], [0, 0, 66], [0, 0, 75], [0, 0, 75], [0, 0, 83], [0, 0, 86], [0, 0, 96], [0, 0, 100], [0, 2, 100]]
51
51
 
52
52
 
53
53
  ## Contributing
@@ -1,3 +1,3 @@
1
1
  module Colorable
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colorable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - kyoendo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-26 00:00:00.000000000 Z
11
+ date: 2013-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec