Use some elif.
[tabakrolletjie.git] / tabakrolletjie / transforms.py
index b748b6e2f545e9a8745f0b869f2c09fde3ddbf4f..50cb1d1de42287b977ba84e1d5a4b8420956b62f 100644 (file)
@@ -64,3 +64,23 @@ class Multiply(Transform):
         mult.fill(self.colour)
         surface.blit(mult, (0, 0), None, pgl.BLEND_RGBA_MULT)
         return surface
+
+
+class MultiplyImage(Transform):
+    """ Apply a colour by multiplying. """
+
+    ARGS = ["image"]
+
+    def apply(self, surface):
+        surface.blit(self.image, (0, 0), None, pgl.BLEND_RGBA_MULT)
+        return surface
+
+
+class Alpha(Transform):
+    """ Make translucent. """
+
+    ARGS = ["alpha"]
+
+    def apply(self, surface):
+        surface.fill((255, 255, 255, self.alpha), None, pgl.BLEND_RGBA_MULT)
+        return surface