Module: Avatarro

Defined in:
lib/avatarro.rb,
lib/avatarro/railtie.rb,
lib/avatarro/version.rb

Defined Under Namespace

Classes: Railtie

Constant Summary collapse

GRADIENTS =
[
  ["#ff9a9e", "#fad0c4", 45, '#444'],
  ["#a18cd1", "#fbc2eb", 90],
  ["#fad0c4", "#ffd1ff", 90],
  ["#ffecd2", "#fcb69f", 90],
  ["#ff8177", "#b12a5b", 90],
  ["#fbc2eb", "#a6c1ee", 90],
  ["#fdcbf1", "#e6dee9", 90, '#444'],
  ["#a1c4fd", "#c2e9fb", 120],
  ["#d4fc79", "#96e6a1", 120],
  ["#cfd9df", "#e2ebf0", 90, '#444'],
  ["#a6c0fe", "#f68084", 120],
  ["#fccb90", "#d57eeb", 120],
  ["#e0c3fc", "#8ec5fc", 120],
  ["#f093fb", "#f5576c", 120],
  ["#43e97b", "#38f9d7", 120],
  ["#30cfd0", "#330867", 90],
  ["#d299c2", "#fef9d7", 120],
  ["#16d9e3", "#46aef7", 120],
  ["#b8cbb8", "#cf6cc9", 90],
  ["#fff1eb", "#ace0f9", 90, '#444'],
  ["#0ba360", "#3cba92", 90],
  ["#9795f0", "#fbc8d4", 90],
  ["#93a5cf", "#e4efe9", 90],
  ["#ffafbd", "#ffc3a0", 45],
  ["#cc2b5e", "#753a88", 180],
  ["#ee9ca7", "#ffdde1", 180],
  ["#42275a", "#734b6d", 90],
  ["#bdc3c7", "#2c3e50", 90],
  ["#06beb6", "#48b1bf", 120],
  ["#eb3349", "#f45c43", 120],
  ["#56ab2f", "#a8e063", 90],
  ["#614385", "#516395", 120],
  ["#d66d75", "#e29587", 290],
  ["#000428", "#004e92", 90],
  ["#ddd6f3", "#faaca8", 90],
  ["#7b4397", "#dc2430", 190],
  ["#4568dc", "#b06ab3", 90],
  ["#4568dc", "#b06ab3", 90],
]
VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.image(initials, args = {}) ⇒ Object



48
49
50
# File 'lib/avatarro.rb', line 48

def Avatarro.image(initials, args = {})
  "data:image/svg+xml;base64,#{Base64.encode64(svg(initials, args))}".html_safe
end

.svg(initials, args = {}) ⇒ Object



52
53
54
# File 'lib/avatarro.rb', line 52

def Avatarro.svg(initials, args = {})
  template(initials, args)
end