I am using Python 3.3. Pygame uses tuples for colors. I need to halve each of the values in a tuple to make a darker color, but many times per second. I could use this function I wrote:
def halfTuple(oldTuple):
newList = []
for item in oldTuple:
newList.append(item * .5)
return tuple(newList)
but it might be slow. Is there a faster way to do this?
It’s likely that creating a new tuple from scratch instead of converting from an array will help: