26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/boring_avatars/variants/ring.rb', line 26
def render(input:, hash:, ids:)
shuffled = Array.new(COLORS) { |index| Utilities.random_color(hash + index, input.colors) }
colors = [
shuffled[0], shuffled[1], shuffled[1], shuffled[2], shuffled[2],
shuffled[3], shuffled[3], shuffled[0], shuffled[4]
]
content = PATHS.each_with_index.map do |path, index|
element("path", { "d" => path, "fill" => colors[index] })
end
content << element("circle", { "cx" => 45, "cy" => 45, "r" => 23, "fill" => colors[8] })
VariantResult.new(size: SIZE, content: content)
end
|