Class: Zyps::BlendAction

Inherits:
Action
  • Object
show all
Defined in:
lib/zyps/actions.rb

Overview

Blend the target’s color with another color.

Instance Attribute Summary collapse

Attributes inherited from Action

#started

Instance Method Summary collapse

Methods inherited from Action

#copy, #start, #started?, #stop

Constructor Details

#initialize(color) ⇒ BlendAction

Returns a new instance of BlendAction.



179
180
181
# File 'lib/zyps/actions.rb', line 179

def initialize(color)
	self.color = color
end

Instance Attribute Details

#colorObject

Color to apply to targets.



178
179
180
# File 'lib/zyps/actions.rb', line 178

def color
  @color
end

Instance Method Details

#do(actor, targets) ⇒ Object

Blend the targets’ color with the assigned color.



183
184
185
186
187
# File 'lib/zyps/actions.rb', line 183

def do(actor, targets)
	targets.each do |target|
		target.color += @color
	end
end