# The Shading Affect - Updated

Hi guys. The is the update to The Shading Affect. Now it is a blend of the colours and repeats them randomly. Hope you enjoy. You can copy and paste this in to Codea and it should work.

``````function setup()
background(0, 0, 0, 255)
one1 = math.random( 255 )
one2 = math.random( 255 )
one3 = math.random( 255 )
two1 = math.random( 255 )
two2 = math.random( 255 )
two3 = math.random( 255 )
three1 = math.random( 255 )
three2 = math.random( 255 )
three3 = math.random( 255 )
four1 = math.random( 255 )
four2 = math.random( 255 )
four3 = math.random( 255 )
s = 700
x = WIDTH/2
y = HEIGHT/2
one = color(one1, one2, one3, 255)
two = color(two1, two2, two3, 255)
three = color(three1, three2, three3, 255)
four = color(four1, four2, four3, 255)
backingMode(RETAINED)
end

function draw()
ellipse(x, y, s)    -- All of the 4 sets of code (staring will ellipse and ending with s =) are very
fill(one)           -- similar. they all create an ellipse at ("x","y") with the size of "s". This
y = y+1             -- allowes the circle to be differnt every time. Then it either adds or subracts 1
s = s-0.5           -- from "x" or "y". This makes the circle change it's postion evry time and makes the
ellipse(x, y, s)    -- shading affect. Next it reduces "s" (the size) by 1 so the next is a bit smaller.
fill(two)           -- This repeats until the value "s" gets to 0.
x = x+1
s = s-0.5
ellipse(x, y, s)
fill(three)
y = y-1
s = s-0.5
ellipse(x, y, s)
fill(four)
x = x-1
s = s-0.5

if s == 0 then
s = 700
one1 = math.random( 255 )
one2 = math.random( 255 )
one3 = math.random( 255 )
two1 = math.random( 255 )
two2 = math.random( 255 )
two3 = math.random( 255 )
three1 = math.random( 255 )
three2 = math.random( 255 )
three3 = math.random( 255 )
four1 = math.random( 255 )
four2 = math.random( 255 )
four3 = math.random( 255 )
one = color(one1, one2, one3, 255)
two = color(two1, two2, two3, 255)
three = color(three1, three2, three3, 255)
four = color(four1, four2, four3, 255)
end

end
``````

@Hazza1423 - please keep your comments in a single thread, for the same project, to avoid cluttering the forum. You can change the title if you want (just edit your first post in the thread).

Also, when including code, put three ~ on a line before the code, and three more on a line after the code. That will make it look nice.