color component difference
This commit is contained in:
parent
05619331aa
commit
1f4b3384ed
|
@ -163,7 +163,18 @@ def get_hue_shifted_surface(base, offset):
|
|||
return surface
|
||||
|
||||
def get_inverted_surface(base):
|
||||
return get_hue_shifted_surface(base, 180)
|
||||
surface = base.copy()
|
||||
pixels = PixelArray(surface)
|
||||
for x in xrange(surface.get_width()):
|
||||
for y in xrange(surface.get_height()):
|
||||
color = Color(*surface.unmap_rgb(pixels[x][y]))
|
||||
if color.hsla[3]:
|
||||
color.r = 255 - color.r
|
||||
color.g = 255 - color.g
|
||||
color.b = 255 - color.b
|
||||
pixels[x][y] = color
|
||||
del pixels
|
||||
return surface
|
||||
|
||||
def fill_tile(surface, tile):
|
||||
for x in xrange(0, surface.get_width(), tile.get_width()):
|
||||
|
|
Loading…
Reference in New Issue