04_Functions + RGB

Dec 04, 2009 21:12






size(200,200)
colormode(RGB, range=255)
background(51)

def drawtarget(xloc, yloc, dsize, num):
grayvalues = 255/num
steps = dsize/num
xcent = xloc - dsize/2
ycent = yloc - dsize/2
for i in range(0, num):
fill(i * grayvalues)
oval(xcent+((i*steps)/2), ycent+((i*steps)/2), dsize-i*steps, dsize-i*steps)

drawtarget(81, 62, 200, 12)
drawtarget(52, 152, 80, 4)
drawtarget(148, 64, 108, 7)

nodebox

Previous post Next post
Up