Class: Zyps::BlendAction
Overview
Blend the target’s color with another color.
Instance Attribute Summary collapse
-
#color ⇒ Object
Color to apply to targets.
Attributes inherited from Action
Instance Method Summary collapse
-
#do(actor, targets) ⇒ Object
Blend the targets’ color with the assigned color.
-
#initialize(color) ⇒ BlendAction
constructor
A new instance of BlendAction.
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
#color ⇒ Object
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 |