summaryrefslogtreecommitdiffstats
path: root/share/extensions/color_negative.py
blob: 94c836414c82a8921352e584ef560e0c37d66680 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python3
"""Reverse the colors"""

import inkex


class Negative(inkex.ColorExtension):
    """Make the colour oposite"""

    def modify_color(self, name, color):
        # Support any colour space
        for i, channel in enumerate(color):
            color[i] = 255 - channel
        return color


if __name__ == "__main__":
    Negative().run()