1 - Create a coordinate grid for the flag including the colors
2 - Create a sine table ( X,Y ) for a full rotation with the radius and steps you need for one coordinate. ( power of 2 size )
3 - Now step with linear interpolation thru the sine table and increase the X,Y coordinate added with the new X,Y sine position.
X starts at 0 degrees.
Y starts at 90 degrees.
Each next horizontal coordinate is one step further in the sine table.
( You can also use the sine values to add some shadow to the colors )
To speed things up, you only have to calculate the left horizontal half of the flag because, it is one full X,Y rotation.
You can copy the coords and colors to the right half of the flag by only updating the X coords.