roar/liboperators/OperatorInvert.py
Lucio Andrés Illanes Albornoz 6a5f75719e Increase roar window height to match default canvas size.
{assets/tools,lib{canvas,gui,roar,rtl,tools}}/*.py: remove Vim fold marker remnants.
2019-09-24 17:02:02 +02:00

22 lines
583 B
Python

#!/usr/bin/env python3
#
# OperatorInvert.py
# Copyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
#
from Operator import Operator
class OperatorInvert(Operator):
name = "Invert colours"
def apply(self, region):
for numRow in range(len(region)):
for numCol in range(len(region[numRow])):
region[numRow][numCol][0:2] = [(~r & (16 - 1) if r > 0 else r) for r in region[numRow][numCol][0:2]]
return region
def __init__(self, *args):
pass
# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120