Method: Satis::Avatar::Component#background_color

Defined in:
app/components/satis/avatar/component.rb

#background_colorObject

Returns the hex-background color for the avatar based on the name or email



29
30
31
32
33
# File 'app/components/satis/avatar/component.rb', line 29

def background_color
  return unless name || email || color

  @background_color = "##{Digest::MD5.hexdigest(name || email).first(6)}"
end