The flag is drawn left to right, drawing one vertical line at a time with a bit of transparency. A sine wave offsets the x and y position of the line, where the lines overlap it renders brighter.
It animated quite slow, but increasing the step size and the line width solved that.
There are a lot of drawbacks using transparency though, a much better solution would be to use the sine wave to adjust the brightness of the colors instead.
[edit] Attached a pic for clarity