summaryrefslogtreecommitdiffstats
path: root/share/extensions/color_negative.py
blob: 940770656718e9e9829ba5dc768da0036ac11ab6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python
"""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()