summaryrefslogtreecommitdiffstats
path: root/share/extensions/tests/test_color_blackandwhite.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:24:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:24:48 +0000
commitcca66b9ec4e494c1d919bff0f71a820d8afab1fa (patch)
tree146f39ded1c938019e1ed42d30923c2ac9e86789 /share/extensions/tests/test_color_blackandwhite.py
parentInitial commit. (diff)
downloadinkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.tar.xz
inkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.zip
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/extensions/tests/test_color_blackandwhite.py')
-rw-r--r--share/extensions/tests/test_color_blackandwhite.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/share/extensions/tests/test_color_blackandwhite.py b/share/extensions/tests/test_color_blackandwhite.py
new file mode 100644
index 0000000..5f54481
--- /dev/null
+++ b/share/extensions/tests/test_color_blackandwhite.py
@@ -0,0 +1,33 @@
+# coding=utf-8
+from color_blackandwhite import BlackAndWhite
+from .test_inkex_extensions import ColorBaseCase
+
+
+class ColorBlackAndWhiteTest(ColorBaseCase):
+ effect_class = BlackAndWhite
+ color_tests = [
+ # When converting to black and white the color white should be unchanged
+ ("none", "none"),
+ ((0, 0, 0), "#000000"),
+ ((255, 255, 255), "#ffffff"),
+ ((192, 192, 192), "#ffffff"),
+ ((128, 128, 128), "#ffffff"),
+ ((128, 0, 0), "#000000"),
+ ((255, 0, 0), "#000000"),
+ ((128, 128, 0), "#000000"),
+ ((255, 255, 0), "#ffffff"),
+ ((0, 128, 0), "#000000"),
+ ((0, 255, 0), "#ffffff"),
+ ((0, 128, 128), "#000000"),
+ ((0, 255, 255), "#ffffff"),
+ ((0, 0, 128), "#000000"),
+ ((0, 0, 255), "#000000"),
+ ((128, 0, 128), "#000000"),
+ ((255, 0, 255), "#000000"),
+ # Increasing the threshold means more colors will be black
+ ((255, 0, 255), "#000000", ["-t 240"]),
+ ((192, 192, 192), "#000000", ["-t 240"]),
+ # Decreasing the threshold means more colors will be white
+ ((255, 0, 255), "#ffffff", ["-t 80"]),
+ ((192, 192, 192), "#ffffff", ["-t 80"]),
+ ]