Class: GeoPattern::ColorGenerators::BaseColorGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/geo_pattern/color_generators/base_color_generator.rb

Overview

Generate color based on Base Color and seed

Instance Method Summary collapse

Constructor Details

#initialize(color, seed, creator = Color) ⇒ BaseColorGenerator

New

Parameters:

  • color (String)

    HTML color string, #0a0a0a


16
17
18
19
20
# File 'lib/geo_pattern/color_generators/base_color_generator.rb', line 16

def initialize(color, seed, creator = Color)
  @color   = color
  @seed    = seed
  @creator = creator
end

Instance Method Details

#generateObject

Generator color


23
24
25
# File 'lib/geo_pattern/color_generators/base_color_generator.rb', line 23

def generate
  creator.new(transform(color, seed))
end