Commit bfbb6ebc90bd52679e1ca0b620088cac80d910e4

Authored by Nicholas Erdenberger
1 parent cba854b3
Exists in master

config accepts custom palette arguements

lib/letter_avatar/colors.rb
1 1 module LetterAvatar
2 2 module Colors
3   - PALETTES = [:google, :iwanthue]
  3 + PALETTES = [:google, :iwanthue, :custom]
4 4  
5 5 GOOGLE_COLORS = [
6 6 [226, 95, 81], # A
... ...
lib/letter_avatar/configuration.rb
... ... @@ -24,6 +24,14 @@ module LetterAvatar
24 24 @colors_palette = v if Colors::PALETTES.include?(v)
25 25 end
26 26  
  27 + def custom_palette
  28 + @custom_palette ||= nil
  29 + end
  30 +
  31 + def custom_palette=(v)
  32 + @custom_palette = v
  33 + end
  34 +
27 35 def weight
28 36 @weight ||= 300
29 37 end
... ...