- 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_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))
-
+ self._fitting_image = loader.load_image(
+ "48", self.FITTING_IMG,
+ transform=ColourWedges(colours=self.colour_cycle))