multicoloured light display
authoradrianna <adrianna.pinska@gmail.com>
Sat, 10 Sep 2016 10:39:21 +0000 (12:39 +0200)
committeradrianna <adrianna.pinska@gmail.com>
Sat, 10 Sep 2016 10:46:16 +0000 (12:46 +0200)
18 files changed:
data/images/32/light_mask_2_1.png [new file with mode: 0644]
data/images/32/light_mask_2_2.png [new file with mode: 0644]
data/images/32/light_mask_3_1.png [new file with mode: 0644]
data/images/32/light_mask_3_2.png [new file with mode: 0644]
data/images/32/light_mask_3_3.png [new file with mode: 0644]
data/images/48/light_mask_2_1.png [new file with mode: 0644]
data/images/48/light_mask_2_2.png [new file with mode: 0644]
data/images/48/light_mask_3_1.png [new file with mode: 0644]
data/images/48/light_mask_3_2.png [new file with mode: 0644]
data/images/48/light_mask_3_3.png [new file with mode: 0644]
data/images/Makefile
sources/vector/light_mask_2_1.svg [new file with mode: 0644]
sources/vector/light_mask_2_2.svg [new file with mode: 0644]
sources/vector/light_mask_3_1.svg [new file with mode: 0644]
sources/vector/light_mask_3_2.svg [new file with mode: 0644]
sources/vector/light_mask_3_3.svg [new file with mode: 0644]
tabakrolletjie/lights.py
tabakrolletjie/transforms.py

diff --git a/data/images/32/light_mask_2_1.png b/data/images/32/light_mask_2_1.png
new file mode 100644 (file)
index 0000000..e95ffee
Binary files /dev/null and b/data/images/32/light_mask_2_1.png differ
diff --git a/data/images/32/light_mask_2_2.png b/data/images/32/light_mask_2_2.png
new file mode 100644 (file)
index 0000000..82fc4ab
Binary files /dev/null and b/data/images/32/light_mask_2_2.png differ
diff --git a/data/images/32/light_mask_3_1.png b/data/images/32/light_mask_3_1.png
new file mode 100644 (file)
index 0000000..c4316c6
Binary files /dev/null and b/data/images/32/light_mask_3_1.png differ
diff --git a/data/images/32/light_mask_3_2.png b/data/images/32/light_mask_3_2.png
new file mode 100644 (file)
index 0000000..9b69af2
Binary files /dev/null and b/data/images/32/light_mask_3_2.png differ
diff --git a/data/images/32/light_mask_3_3.png b/data/images/32/light_mask_3_3.png
new file mode 100644 (file)
index 0000000..da894e7
Binary files /dev/null and b/data/images/32/light_mask_3_3.png differ
diff --git a/data/images/48/light_mask_2_1.png b/data/images/48/light_mask_2_1.png
new file mode 100644 (file)
index 0000000..245f371
Binary files /dev/null and b/data/images/48/light_mask_2_1.png differ
diff --git a/data/images/48/light_mask_2_2.png b/data/images/48/light_mask_2_2.png
new file mode 100644 (file)
index 0000000..8d7ab24
Binary files /dev/null and b/data/images/48/light_mask_2_2.png differ
diff --git a/data/images/48/light_mask_3_1.png b/data/images/48/light_mask_3_1.png
new file mode 100644 (file)
index 0000000..7c8e0ca
Binary files /dev/null and b/data/images/48/light_mask_3_1.png differ
diff --git a/data/images/48/light_mask_3_2.png b/data/images/48/light_mask_3_2.png
new file mode 100644 (file)
index 0000000..beff279
Binary files /dev/null and b/data/images/48/light_mask_3_2.png differ
diff --git a/data/images/48/light_mask_3_3.png b/data/images/48/light_mask_3_3.png
new file mode 100644 (file)
index 0000000..c3e4fda
Binary files /dev/null and b/data/images/48/light_mask_3_3.png differ
index c9077baec232f9a0d825160d897a03fc092591ff..641c3e58227660d99187fbb97d42ae2a5b02442a 100644 (file)
@@ -1,16 +1,18 @@
 VPATH=../../sources/vector
 
+SEED=seed
 TURNIP=turnip1 turnip2 turnip3
 MOULD_BODY=mouldA mouldB mouldC
 MOULD=eyeballA eyeballB eyeballC
 LIGHT=spotlight lamp laser
+LIGHT_MASK=light_mask_2_1 light_mask_2_2 light_mask_3_1 light_mask_3_2 light_mask_3_3
 
 IMG16=$(MOULD_BODY)
-IMG32=$(MOULD_BODY) $(MOULD) $(LIGHT) seed
-IMG48=$(LIGHT) $(TURNIP)
+IMG32=$(MOULD_BODY) $(MOULD) $(LIGHT) $(SEED) $(LIGHT_MASK)
+IMG48=$(LIGHT) $(TURNIP) $(LIGHT_MASK)
 IMG64=$(MOULD_BODY)
 
-CURSORS=seed $(LIGHT)
+CURSORS=$(SEED) $(LIGHT)
 
 PNG16=$(patsubst %, 16/%.png, $(IMG16))
 PNG32=$(patsubst %, 32/%.png, $(IMG32))
diff --git a/sources/vector/light_mask_2_1.svg b/sources/vector/light_mask_2_1.svg
new file mode 100644 (file)
index 0000000..728794b
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="100mm"
+   height="100mm"
+   viewBox="0 0 354.33071 354.33071"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="light_mask_2_1.svg">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.7"
+     inkscape:cx="299.65034"
+     inkscape:cy="154.13204"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1264"
+     inkscape:window-height="720"
+     inkscape:window-x="102"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:object-nodes="true"
+     inkscape:snap-smooth-nodes="true">
+    <inkscape:grid
+       type="xygrid"
+       id="grid4423"
+       units="mm"
+       spacingx="3.543307"
+       spacingy="3.543307" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-698.0315)">
+    <path
+       style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path4146"
+       sodipodi:type="arc"
+       sodipodi:cx="177.16536"
+       sodipodi:cy="875.19684"
+       sodipodi:rx="256.88977"
+       sodipodi:ry="256.88977"
+       sodipodi:start="4.712389"
+       sodipodi:end="1.5707963"
+       d="M 177.16536,618.30707 A 256.88977,256.88977 0 0 1 434.05513,875.19684 256.88977,256.88977 0 0 1 177.16537,1132.0866 l -1e-5,-256.88976 z" />
+  </g>
+</svg>
diff --git a/sources/vector/light_mask_2_2.svg b/sources/vector/light_mask_2_2.svg
new file mode 100644 (file)
index 0000000..a795c14
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="100mm"
+   height="100mm"
+   viewBox="0 0 354.33071 354.33071"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="light_mask_2_2.svg">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.7"
+     inkscape:cx="299.65034"
+     inkscape:cy="154.13204"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1264"
+     inkscape:window-height="720"
+     inkscape:window-x="102"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:object-nodes="true"
+     inkscape:snap-smooth-nodes="true">
+    <inkscape:grid
+       type="xygrid"
+       id="grid4423"
+       units="mm"
+       spacingx="3.543307"
+       spacingy="3.543307" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-698.0315)">
+    <path
+       style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path4146"
+       sodipodi:type="arc"
+       sodipodi:cx="177.16536"
+       sodipodi:cy="875.19684"
+       sodipodi:rx="256.88977"
+       sodipodi:ry="256.88977"
+       sodipodi:start="1.5707963"
+       sodipodi:end="4.712389"
+       d="m 177.16537,1132.0866 a 256.88977,256.88977 0 0 1 -222.473076,-128.4449 256.88977,256.88977 0 0 1 -10e-7,-256.88975 256.88977,256.88977 0 0 1 222.473067,-128.44488 l 0,256.88977 z" />
+  </g>
+</svg>
diff --git a/sources/vector/light_mask_3_1.svg b/sources/vector/light_mask_3_1.svg
new file mode 100644 (file)
index 0000000..19e6ab7
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="100mm"
+   height="100mm"
+   viewBox="0 0 354.33071 354.33071"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="light_mask_3_1.svg">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.7"
+     inkscape:cx="71.078911"
+     inkscape:cy="154.13204"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1264"
+     inkscape:window-height="720"
+     inkscape:window-x="102"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:object-nodes="true"
+     inkscape:snap-smooth-nodes="true">
+    <inkscape:grid
+       type="xygrid"
+       id="grid4423"
+       units="mm"
+       spacingx="3.543307"
+       spacingy="3.543307" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-698.0315)">
+    <path
+       style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path4146"
+       sodipodi:type="arc"
+       sodipodi:cx="177.16536"
+       sodipodi:cy="875.19684"
+       sodipodi:rx="256.88977"
+       sodipodi:ry="256.88977"
+       sodipodi:start="4.712389"
+       sodipodi:end="0.52359878"
+       d="m 177.16536,618.30707 a 256.88977,256.88977 0 0 1 222.47307,128.44489 256.88977,256.88977 0 0 1 0,256.88974 L 177.16536,875.19684 Z" />
+  </g>
+</svg>
diff --git a/sources/vector/light_mask_3_2.svg b/sources/vector/light_mask_3_2.svg
new file mode 100644 (file)
index 0000000..98ecf9f
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="100mm"
+   height="100mm"
+   viewBox="0 0 354.33071 354.33071"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="light_mask_3_2.svg">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.7"
+     inkscape:cx="-157.49252"
+     inkscape:cy="154.13204"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1264"
+     inkscape:window-height="720"
+     inkscape:window-x="102"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:object-nodes="true"
+     inkscape:snap-smooth-nodes="true">
+    <inkscape:grid
+       type="xygrid"
+       id="grid4423"
+       units="mm"
+       spacingx="3.543307"
+       spacingy="3.543307" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-698.0315)">
+    <path
+       style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path4146"
+       sodipodi:type="arc"
+       sodipodi:cx="177.16536"
+       sodipodi:cy="875.19684"
+       sodipodi:rx="256.88977"
+       sodipodi:ry="256.88977"
+       sodipodi:start="0.52359878"
+       sodipodi:end="2.6179939"
+       d="M 399.63843,1003.6417 A 256.88977,256.88977 0 0 1 177.16536,1132.0866 256.88977,256.88977 0 0 1 -45.307711,1003.6417 L 177.16536,875.19684 Z" />
+  </g>
+</svg>
diff --git a/sources/vector/light_mask_3_3.svg b/sources/vector/light_mask_3_3.svg
new file mode 100644 (file)
index 0000000..a3071b4
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="100mm"
+   height="100mm"
+   viewBox="0 0 354.33071 354.33071"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="light_mask_3_3.svg">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.7"
+     inkscape:cx="71.078911"
+     inkscape:cy="154.13204"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1264"
+     inkscape:window-height="720"
+     inkscape:window-x="102"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:object-nodes="true"
+     inkscape:snap-smooth-nodes="true">
+    <inkscape:grid
+       type="xygrid"
+       id="grid4423"
+       units="mm"
+       spacingx="3.543307"
+       spacingy="3.543307" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-698.0315)">
+    <path
+       style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path4146"
+       sodipodi:type="arc"
+       sodipodi:cx="177.16536"
+       sodipodi:cy="875.19684"
+       sodipodi:rx="256.88977"
+       sodipodi:ry="256.88977"
+       sodipodi:start="2.6179939"
+       sodipodi:end="4.712389"
+       d="m -45.307711,1003.6417 a 256.88977,256.88977 0 0 1 6e-6,-256.88975 256.88977,256.88977 0 0 1 222.473065,-128.44488 l 0,256.88977 z" />
+  </g>
+</svg>
index 03adf387cb2fb299ac57bc2942d7870532c31719..b2e081201ae27bf9113146ba4a3106389a4bda44 100644 (file)
@@ -12,7 +12,7 @@ from .constants import LIGHT_CATEGORY, FITTINGS_CATEGORY, COLOURS
 from .rays import RayPolyManager
 from .utils import DetailedTimer
 from .loader import loader
-from .transforms import Multiply
+from .transforms import Multiply, MultiplyImage
 
 LIGHT_FILTER = pymunk.ShapeFilter(
     mask=pymunk.ShapeFilter.ALL_MASKS ^ (
@@ -124,6 +124,7 @@ class BaseLight(object):
             self.body, self.FITTING_RADIUS, self.ray_manager.position)
         self.fitting.filter = FITTINGS_FILTER
         self._fitting_image = None
+        self._colour_mult_image = None
 
     @property
     def position(self):
@@ -200,10 +201,30 @@ class BaseLight(object):
 
     def fitting_image(self):
         if self._fitting_image is None:
-            fitting_colour = COLOURS[self.colour]
-            self._fitting_image = loader.load_image(
+            fitting_colours = [COLOURS[c] for c in self.colour_cycle]
+            ncolour = len(fitting_colours)
+            if ncolour > 3:
+                print "Multicoloured light should not have more than 3 colours"
+                ncolour = 3
+
+            if ncolour == 1:
+                self._fitting_image = loader.load_image(
                 "48", self.FITTING_IMG,
-                transform=Multiply(colour=fitting_colour))
+                transform=Multiply(colour=fitting_colours[0]))
+            else:
+                if self._colour_mult_image is None:
+                    self._colour_mult_image = pygame.surface.Surface((48, 48))
+
+                    for i in range(ncolour):
+                        sector = loader.load_image(
+                            "48", "light_mask_%d_%d.png" % (ncolour, i + 1),
+                            transform=Multiply(colour=fitting_colours[i]))
+                        self._colour_mult_image.blit(sector, (0,0), None, 0)
+                    
+                self._fitting_image = loader.load_image(
+                    "48", self.FITTING_IMG,
+                    transform=MultiplyImage(image=self._colour_mult_image))
+
         return self._fitting_image
 
     def invalidate_fitting_image(self):
@@ -233,14 +254,6 @@ class Lamp(BaseLight):
     FITTING_IMG = "lamp.png"
 
 
-class MultiColourLamp(BaseLight):
-
-    FITTING_IMG = "lamp.png"
-
-    def __init__(self, **kw):
-        super(MultiColourLamp, self).__init__(**kw)
-
-
 class PulsatingLamp(BaseLight):
 
     FITTING_IMG = "lamp.png"
index 88f516169e02dfe46ff22523eb28a353ad421a75..50cb1d1de42287b977ba84e1d5a4b8420956b62f 100644 (file)
@@ -66,6 +66,16 @@ class Multiply(Transform):
         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. """