Greetings,
i wonder why single values of a color are not editable from the getter. I understand the "getColor()" method returns a constant to avoid deletion from memory. But then wouldn't it be viable to allow actively setting the values within that color?
If i only want to change something's "blue" component, why should i replace a color?
The only way i found till now was something like:
sprite.setColor(sprite.getColor().r, sprite.getColor().g, sprite.getColor().b + blue_variation, sprite.getColor().a + alpha_variation);
Wouldn't something like the following be more cpu-efficient, readable and clean?
sprite.getColor().setBlue(new_blue_value);
sprite.getColor().modifyBlue(blue_variation);