At the beginning of the piston, the values for brightness, color and the status (on/off) are written to constants. Then the lamp is dimmed in a loop. When the loop is finished, the old state of the lamp should be restored. For this purpose, the values from the constants are used, which now contain different values than at the beginning of the pistons.
Why do constants change?
Thank you for helpful answers.