Advertisement
SimonMage

switchRedOnBlue

Nov 6th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. def switchRedBlue(pict,k):
  2. # @param pict: Picture
  3. # @param k: int
  4.   for p in getPixels(pict):
  5.     x = getX(p)
  6.     if x < k:
  7.       oRed = getRed(p)
  8.       oBlue = getBlue(p)
  9.       setRed(p,oBlue)
  10.       setBlue(p,oRed)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement