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.
- checksums.yaml +4 -4
- data/README.md +51 -11
- data/bin/console +0 -0
- data/lib/husl/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 540e8f2843428c702d8c94712e0e850d6a9238c1
|
4
|
+
data.tar.gz: c863a75b3b3bf76d304688cfaeb05d28ef9411d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29c72427e3f87cd573655fa5a0bccf44c4c14c0a187c2ff0ee805067f75b11d5b648e51701092d5fa33b33ec02ce7d52ae41ace451228ce9292d0927c2f5d251
|
7
|
+
data.tar.gz: e8fe0b7666d31de57e505a84e62f6aae5d6f8bb4fd6dfc5b566fda054190651e5c0ee5ef8a122789b9508dee1fe469d3080350e92abd28ab5a002162529e3d0f
|
data/README.md
CHANGED
@@ -1,7 +1,14 @@
|
|
1
|
-
|
1
|
+
[](https://travis-ci.org/husl-colors/husl-ruby)
|
2
|
+
[](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
|
+

|
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
|
-
|
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
|
-
|
38
|
+
#### Husl::husl_to_hex(hue, saturation, lightness) -> color as a hex string
|
26
39
|
|
27
|
-
|
40
|
+
```
|
41
|
+
Husl.husl_to_hex(12.177, 100, 53.23)
|
42
|
+
=> #ff0000
|
43
|
+
```
|
28
44
|
|
29
|
-
|
45
|
+
#### Husl::husl_to_rgb(hue, saturation, lightness) -> color as rgb
|
30
46
|
|
31
|
-
|
47
|
+
```
|
48
|
+
Husl.husl_to_rgb(12.177, 100, 53.23)
|
49
|
+
=> [0.9998643703868711, 6.849859221502719e-14, 8.791283550555612e-06]
|
50
|
+
```
|
32
51
|
|
33
|
-
|
52
|
+
#### Husl::hex_to_husl(hex) -> list of floats as defined above
|
34
53
|
|
35
|
-
|
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
|
-
|
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
|
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
|
data/bin/console
CHANGED
File without changes
|
data/lib/husl/version.rb
CHANGED
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:
|
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-
|
11
|
+
date: 2015-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|