Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def diagonal(pict,x,y,color):
- #@param:
- # pict: picture;
- # x: int, starting x coordinate;
- # y: int, starting y coordinate;
- # color: color;
- width = getWidth(pict)
- height = getHeight(pict)
- assert x<width and y<height and x>=0 and y>=0, "Invalid parameters, x or y is smaller than 0 or bigger than picture size."
- i = 0
- while i<width-x and i<height-y:
- pix = getPixel(pict,x+i,y+i)
- setColor(pix,color)
- i +=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement