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.
182 183 184 |
# File 'lib/zyps/actions.rb', line 182 def initialize(color) self.color = color end |
Instance Attribute Details
#color ⇒ Object
Color to apply to targets.
181 182 183 |
# File 'lib/zyps/actions.rb', line 181 def color @color end |
Instance Method Details
#do(actor, targets) ⇒ Object
Blend the targets’ color with the assigned color.
186 187 188 189 190 |
# File 'lib/zyps/actions.rb', line 186 def do(actor, targets) targets.each do |target| target.color += @color end end |