Module: Colorly::DSL

Included in:
Script
Defined in:
lib/colorly/dsl.rb

Instance Method Summary collapse

Instance Method Details

#add(color) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/colorly/dsl.rb', line 7

def add(color)
  if color.is_a? Array
    color.each { |c| add c }
  else
    output[current_title] ||= []
    register color
    output[current_title] << last
  end
end

#lastObject



17
18
19
# File 'lib/colorly/dsl.rb', line 17

def last
  @last ||= 'red'.paint
end

#randomObject



21
22
23
# File 'lib/colorly/dsl.rb', line 21

def random
  '#%06x' % (rand * 0xffffff)
end

#title(title) ⇒ Object



3
4
5
# File 'lib/colorly/dsl.rb', line 3

def title(title)
  @current_title = title
end