Pretty simple really. Elegant code only 17 lines. study/copy this code and study how the variables change. Don't let the triple nested for loop confuse you, thats mostly to fill in the grid row by row, with changes to the rgb values only happening at the end of each row for the gradient effect.
Oh I didn't know. Well for starters, the R, G, and B variables are the red green and blue values. You can alter those and their starting values for different colors. RC is the radius of the circle. Change GX to GX=GX+1 and look at the difference.