Reputation: 945
I am changing the color of my sprite using the following code
sprite.color = ccc3(255, 0, 0);
it changes the color to red..
How can I change the color to what it was??
Thanks..
Upvotes: 2
Views: 5210
Reputation: 3133
You can return to original color by using
sprite.color = ccc3(255, 255, 255);
the original color was not lost. the tint methods (ccc3 in this case) are not adding-color, but darkening the individual RGB channels. That's the reason you cant tint a black image to any other color.
In your example, you didn't paint your sprite Red. You've just cut all channels except the red one
Upvotes: 7