[Solved] How to add each element of a tuple or list by a fixed value?


Since your tuples are just repeating the same number, just use a range loop and create the tuple from scratch:

for i in range(256):
    rgb = (i, i, i)

There is no need to add up here.

Alternatively, calculate i from the frame. 30 frames in a second? Divide 256 by 30 to get a step size, then use the frame number:

step = 256 / 30.0
value = int(frame * step)
rgb = (value, value, value)

7

solved How to add each element of a tuple or list by a fixed value?