Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def diag45(pict,x,y,c):
- #@param pict: Picture
- #@param x: int
- #@param y: int
- #@param c: color
- w,h = getWidth(pict)-1, getHeight(pict)-1
- if x<0 or x>=w or y<0 or y>=h:
- return
- else:
- iter = min(w-x,h-y)
- px = getPixel(pict,x,y)
- setColor(px,c)
- for i in range(iter):
- x+=1
- y+=1
- px = getPixel(pict,x,y)
- setColor(px,c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement