letter_avatar 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97bcbc095f0408ec7d44fca674a71b187fbc9ddd
4
- data.tar.gz: 3d62353ec56b3fd0ee710510766e8ad2ca5f7405
3
+ metadata.gz: 2b3e894eb2935644884d0bb884aed9cf07be4580
4
+ data.tar.gz: 6fce9e3db60337ff2b9bf1ec7ba3947dc033f079
5
5
  SHA512:
6
- metadata.gz: f0dcd512bb005824a0c74a75f25e5a624cdaebd5e492f7141836bcbf684c35a7845d3488f6defdf94b3bf3f163b539eca384e46cdb46e22c76f6da2188be1a7e
7
- data.tar.gz: d318261498e46bd130863489d143a1f8d74ca670f54f03c4f8309bbf0a85049902064714528b06d84b5075bb76fe5b8de62b1970e0d47f09ab3ac3185d5ed89c
6
+ metadata.gz: cbe7868ac9267dae719add1673266aa8a4b09a0ca3428690bb63214bc3563f723c9e9d505b19b081ac74b2c87252bac31ba1713f8dfe6cc2c29592a06b022f95
7
+ data.tar.gz: c45893a953e35cf75045cb84e01f5faeec363c3b9cf5088b3ef77b81707d97b07a3b5f111b8c83831d88057c72d18a380dccb9f9cb43c1bb1315d9208ad3a041
data/README.md CHANGED
@@ -53,6 +53,14 @@ LetterAvatar.setup do |config|
53
53
  end
54
54
  ```
55
55
 
56
+ #### Color palette
57
+
58
+ We have two color palettes implemented: `iwanthue` and `google`.
59
+
60
+ Each of them have different colors, but the `iwanthue` also differently calculates the color for specyfied username.
61
+
62
+ The `google` selected will generate the same avatar for both, "Krzysiek" and "ksz2k" usernames given (both of them starts with letter "k"), but `iwanthue` will calculate it's md5 and then selects color, so there's huge chance that these usernames get different colors.
63
+
56
64
  ## Usage
57
65
 
58
66
  ```ruby
@@ -72,6 +80,8 @@ There's also helper for this. To use it, you need:
72
80
 
73
81
  ```ruby
74
82
  letter_avatar_for('ksz2k', 200)
83
+ # or even
84
+ letter_avatar_tag('ksz2k', 200, class: 'av')
75
85
  ```
76
86
 
77
87
  ### Way to support non [a-z0-9] charsets
@@ -20,7 +20,7 @@ module LetterAvatar
20
20
  def self.from_username(username)
21
21
  identity = new
22
22
  identity.color = LetterAvatar::Colors.for(username)
23
- identity.letter = username.first.upcase
23
+ identity.letter = username[0].upcase
24
24
 
25
25
  identity
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module LetterAvatar
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letter_avatar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - discourse developers
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-11-13 00:00:00.000000000 Z
14
+ date: 2015-11-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler