Sha256: 44d6127b74ee86e923d142bd0cec9ce23f5780ec0cca248bf8c9163ca3269b17
Contents?: true
Size: 523 Bytes
Versions: 2
Compression:
Stored size: 523 Bytes
Contents
module Cheers class Eyes < ImageComponent IMAGES = %w( eyes/1.png eyes/2.png eyes/3.png eyes/4.png eyes/5.png ) attr_reader :color, :image def initialize(canvas, color_randomizer, image_randomizer = nil) super @color = ContrastingColorPicker.new(Avatar::COMPONENT_COLORS, extract_background_color(canvas)).pick(color_randomizer) @image = IMAGES.sample random: self.image_randomizer end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cheers-0.0.4 | lib/cheers/eyes.rb |
cheers-0.0.3 | lib/cheers/eyes.rb |