Sha256: 22c206f1256eb601db18a3be8b83df5e293cf43caacda25d3ce2a5ad60574d54

Contents?: true

Size: 491 Bytes

Versions: 2

Compression:

Stored size: 491 Bytes

Contents

module Cheers
  class Mouth < ImageComponent
    
    IMAGES = %w( mouths/1-smile.png
                 mouths/2-smile.png
                 mouths/3-smile.png )
    
    attr_reader :color, :image
    
    def initialize(canvas, color_randomizer, element_randomizer = nil)
      super
      
      @color = ContrastingColorPicker.new(Avatar::COMPONENT_COLORS, extract_background_color(canvas)).pick(color_randomizer)
      @image = IMAGES.sample random: element_randomizer
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cheers-0.0.4 lib/cheers/mouth.rb
cheers-0.0.3 lib/cheers/mouth.rb