projects
/
naja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3e46045
)
Allow custom flags for blending.
author
Simon Cross
<hodgestar@gmail.com>
Fri, 16 May 2014 23:23:40 +0000
(
01:23
+0200)
committer
Simon Cross
<hodgestar@gmail.com>
Fri, 16 May 2014 23:26:53 +0000
(
01:26
+0200)
naja/resources/mutators.py
patch
|
blob
|
history
diff --git
a/naja/resources/mutators.py
b/naja/resources/mutators.py
index 36ef2297671d7cc5382d93d6f68430eea163faf3..e3fc67a0c011805b3f51d56d704948daf6faa791 100644
(file)
--- a/
naja/resources/mutators.py
+++ b/
naja/resources/mutators.py
@@
-41,18
+41,18
@@
def scale_multiplier(image, factor):
return scale(image, size)
return scale(image, size)
-def blend_add(image, colour):
+def blend_add(image, colour
, flags=pgl.BLEND_ADD
):
"""Overlay the image with the given colour using BLEND_ADD"""
blend = surface.Surface(image.get_size())
blend.fill(colour)
# We return a copy
blended_image = image.copy()
"""Overlay the image with the given colour using BLEND_ADD"""
blend = surface.Surface(image.get_size())
blend.fill(colour)
# We return a copy
blended_image = image.copy()
- blended_image.blit(blend, (0, 0), special_flags=
pgl.BLEND_ADD
)
+ blended_image.blit(blend, (0, 0), special_flags=
flags
)
return blended_image
return blended_image
-def blender(colour):
- return Mutator(blend_add, tuple(colour))
+def blender(colour
, flags=pgl.BLEND_ADD
):
+ return Mutator(blend_add, tuple(colour)
, flags
)
# Identity mutator
# Identity mutator