husl 0.1.0 → 1.0.0

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 (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +51 -11
  3. data/bin/console +0 -0
  4. data/lib/husl/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 802b38dbbe059a518dd54868775ecb5947c307e9
4
- data.tar.gz: bb97a320ddc75100acc0f8d3f0a67fb6101e37f9
3
+ metadata.gz: 540e8f2843428c702d8c94712e0e850d6a9238c1
4
+ data.tar.gz: c863a75b3b3bf76d304688cfaeb05d28ef9411d2
5
5
  SHA512:
6
- metadata.gz: b1cb618f1f8ad0e631078919245b3e842e32234fd33f5c3daf8a2c64e716db28a5e3cdc1accf3254f54de2a949230bcbe0b5f60601fa849d7be0e67fa620ba76
7
- data.tar.gz: 47054b907542db4ee93704f76375746b53c4c20edbfa3fd39b5e3c90da258f657dd74ed4bcdd17038234bb4ee8bbbeed2f738df2307ef264df43b1c1d1bfc9c5
6
+ metadata.gz: 29c72427e3f87cd573655fa5a0bccf44c4c14c0a187c2ff0ee805067f75b11d5b648e51701092d5fa33b33ec02ce7d52ae41ace451228ce9292d0927c2f5d251
7
+ data.tar.gz: e8fe0b7666d31de57e505a84e62f6aae5d6f8bb4fd6dfc5b566fda054190651e5c0ee5ef8a122789b9508dee1fe469d3080350e92abd28ab5a002162529e3d0f
data/README.md CHANGED
@@ -1,7 +1,14 @@
1
- # Husl
1
+ [![Build Status](https://travis-ci.org/husl-colors/husl-ruby.svg)](https://travis-ci.org/husl-colors/husl-ruby)
2
+ [![Gem Version](https://badge.fury.io/rb/husl.svg)](http://badge.fury.io/rb/husl)
2
3
 
3
4
  A Ruby implementation of [HUSL](http://www.husl-colors.org).
4
5
 
6
+ ## Demo
7
+
8
+ ![Demo](http://i.imgur.com/GTsNT8u.gif)
9
+
10
+ Demo link: http://www.husl-colors.org/syntax/#006925
11
+
5
12
  ## Installation
6
13
 
7
14
  Add this line to your application's Gemfile:
@@ -20,24 +27,57 @@ Or install it yourself as:
20
27
 
21
28
  ## Usage
22
29
 
23
- **husl_to_hex(hue, saturation, lightness)**
30
+ - `hue` is a float between 0 and 360
31
+ - `saturation` is a float between 0 and 100
32
+ - `lightness` is a float between 0 and 100
33
+ - `hex` is the hexadecimal format of the color
34
+ - `red` is a float between 0 and 1
35
+ - `green` is a float between 0 and 1
36
+ - `blue` is a float between 0 and 1
24
37
 
25
- `hue` is a float between 0 and 360, `saturation` and `lightness` are floats between 0 and 100. This function returns the resulting color as a hex string.
38
+ #### Husl::husl_to_hex(hue, saturation, lightness) -> color as a hex string
26
39
 
27
- **husl_to_rgb(hue, saturation, lightness)**
40
+ ```
41
+ Husl.husl_to_hex(12.177, 100, 53.23)
42
+ => #ff0000
43
+ ```
28
44
 
29
- Like above, but returns a list of 3 floats between 0 and 1, for each RGB channel.
45
+ #### Husl::husl_to_rgb(hue, saturation, lightness) -> color as rgb
30
46
 
31
- **hex_to_husl(hex)**
47
+ ```
48
+ Husl.husl_to_rgb(12.177, 100, 53.23)
49
+ => [0.9998643703868711, 6.849859221502719e-14, 8.791283550555612e-06]
50
+ ```
32
51
 
33
- Takes a hex string and returns the HUSL color as a list of floats as defined above.
52
+ #### Husl::hex_to_husl(hex) -> list of floats as defined above
34
53
 
35
- **rgb_to_husl(red, green, blue)**
54
+ ```
55
+ Husl.hex_to_husl("#ff0000")
56
+ => [12.177050630061776, 100.0000000000022, 53.23711559542933]
57
+ ```
58
+
59
+ #### Husl::rgb_to_husl(rgb) -> list of floats as defined above
36
60
 
37
- Like above, but `red`, `green` and `blue` are passed as floats between 0 and 1.
61
+ ```
62
+ Husl.rgb_to_husl(0.99, 6.84e-14, 8.79e-16)
63
+ => [12.17705063006216, 100.00000000000209, 52.711595266911985]
64
+ ```
38
65
 
39
- For HUSLp (the pastel variant), use `huslp_to_hex`, `huslp_to_rgb`, `hex_to_huslp` and `rgb_to_huslp`.
66
+ For HUSLp (the pastel variant), use:
67
+
68
+ - `huslp_to_hex`
69
+ - `huslp_to_rgb`
70
+ - `hex_to_huslp`
71
+ - `rgb_to_huslp`
40
72
 
41
73
  ## Testing
42
74
 
43
- Run `rspec spec/`.
75
+ Run `rspec spec/`.
76
+
77
+ ## Contributing
78
+
79
+ 1. Fork it ( https://github.com/husl-colors/husl-ruby/fork )
80
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
81
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
82
+ 4. Push to the branch (`git push origin my-new-feature`)
83
+ 5. Create a new Pull Request
File without changes
@@ -1,3 +1,3 @@
1
1
  module Husl
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: husl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Radu-Bogdan Croitoru
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-09 00:00:00.000000000 Z
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler