From a25955f01bc09592267b8c46f57bb67298c0b5f3 Mon Sep 17 00:00:00 2001 From: Krzysiek Szczuka Date: Tue, 5 Feb 2019 19:33:58 +0100 Subject: [PATCH] v0.3.7 --- CHANGELOG.md | 6 ++++++ README.md | 13 ++++++++++++- lib/letter_avatar/version.rb | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52ca6e5..8aac3de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +0.3.7 +----- + +- added `LetterAvatar.custom_palette` config option. +- bumped `FULLSIZE` to 600. + 0.3.6 ----- diff --git a/README.md b/README.md index eec65e3..f3c54d7 100644 --- a/README.md +++ b/README.md @@ -61,12 +61,23 @@ end #### Color palette -We have two color palettes implemented: `iwanthue` and `google`. +We have three color palettes implemented: `iwanthue`, `google` and `custom`. Each of them have different colors, but the `iwanthue` also differently calculates the color for specified username. 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. +##### Custom palette definition + +You can define your own `custom` palette: + +```ruby +LetterAvatar.setup do |config| + config.colors_palette = :custom + config.custom_palette = [[120, 132, 205], [91, 149, 249], [72, 194, 249], [69, 208, 226]] +end +``` + ## Usage ```ruby diff --git a/lib/letter_avatar/version.rb b/lib/letter_avatar/version.rb index 69338de..349e3b2 100644 --- a/lib/letter_avatar/version.rb +++ b/lib/letter_avatar/version.rb @@ -1,3 +1,3 @@ module LetterAvatar - VERSION = '0.3.6' + VERSION = '0.3.7' end