Commit cf00f6e54e1e24770957c345715610481aeb6e5e

Authored by aafaq-hassan
Committed by GitHub
1 parent 3720fe86
Exists in master

letters_count, pointsize configurations utilized

Showing 1 changed file with 3 additions and 2 deletions   Show diff stats
lib/letter_avatar/avatar.rb
... ... @@ -18,7 +18,8 @@ module LetterAvatar
18 18 def self.from_username(username)
19 19 identity = new
20 20 identity.color = LetterAvatar::Colors.for(username)
21   - identity.letter = username[0].upcase
  21 + letters = username.split(/\s+/).map {|word| word[0]}.join('')[0..LetterAvatar.letters_count - 1]
  22 + identity.letter = letters.upcase
22 23  
23 24 identity
24 25 end
... ... @@ -65,7 +66,7 @@ module LetterAvatar
65 66 convert
66 67 -size #{FULLSIZE}x#{FULLSIZE}
67 68 xc:#{to_rgb(identity.color)}
68   - -pointsize 140
  69 + -pointsize #{LetterAvatar.pointsize}
69 70 -font #{FONT_FILENAME}
70 71 -weight #{LetterAvatar.weight}
71 72 -fill '#{LetterAvatar.fill_color}'
... ...