I have two SKSpriteNode and their colors are defined like this:
colorNode[0].color = UIColor(red: 255, green: 0, blue: 0, alpha: 1)
colorNode[1].color = UIColor(red: 0, green: 255, blue: 0, alpha: 1)
and I want to have a third SKSpriteNode colorized with a blend of the two first ones, the result should be like this :
colorNode[2].color = UIColor(red: 255, green: 255, blue: 0, alpha: 1)
but is there a way to addition two UIColors ? Like this :
colorNode[2].color = colorNode[0].color + colorNode[1].color
How about something like this:
Define operators to add colors and multiply a color by a
Double
:Then you can blend colors like this: