Commit a25955f01bc09592267b8c46f57bb67298c0b5f3

Authored by Krzysiek Szczuka
1 parent bb7cbf95
Exists in master

v0.3.7

CHANGELOG.md
  1 +0.3.7
  2 +-----
  3 +
  4 +- added `LetterAvatar.custom_palette` config option.
  5 +- bumped `FULLSIZE` to 600.
  6 +
1 7 0.3.6
2 8 -----
3 9  
... ...
README.md
... ... @@ -61,12 +61,23 @@ end
61 61  
62 62 #### Color palette
63 63  
64   -We have two color palettes implemented: `iwanthue` and `google`.
  64 +We have three color palettes implemented: `iwanthue`, `google` and `custom`.
65 65  
66 66 Each of them have different colors, but the `iwanthue` also differently calculates the color for specified username.
67 67  
68 68 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.
69 69  
  70 +##### Custom palette definition
  71 +
  72 +You can define your own `custom` palette:
  73 +
  74 +```ruby
  75 +LetterAvatar.setup do |config|
  76 + config.colors_palette = :custom
  77 + config.custom_palette = [[120, 132, 205], [91, 149, 249], [72, 194, 249], [69, 208, 226]]
  78 +end
  79 +```
  80 +
70 81 ## Usage
71 82  
72 83 ```ruby
... ...
lib/letter_avatar/version.rb
1 1 module LetterAvatar
2   - VERSION = '0.3.6'
  2 + VERSION = '0.3.7'
3 3 end
... ...