From 84c542f883e16a7f40c70e8a7096b92c063a0e7f Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sat, 17 May 2014 01:23:40 +0200 Subject: [PATCH] Allow custom flags for blending. --- naja/resources/mutators.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/naja/resources/mutators.py b/naja/resources/mutators.py index 36ef229..e3fc67a 100644 --- a/naja/resources/mutators.py +++ b/naja/resources/mutators.py @@ -41,18 +41,18 @@ def scale_multiplier(image, factor): 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() - blended_image.blit(blend, (0, 0), special_flags=pgl.BLEND_ADD) + blended_image.blit(blend, (0, 0), special_flags=flags) 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 -- 2.34.1