1# coding=utf-8
2from color_blackandwhite import BlackAndWhite
3from .test_inkex_extensions import ColorBaseCase
4
5class ColorBlackAndWhiteTest(ColorBaseCase):
6    effect_class = BlackAndWhite
7    color_tests = [
8        # When converting to black and white the color white should be unchanged
9        ("none", "none"),
10        ((0, 0, 0), "#000000"),
11        ((255, 255, 255), "#ffffff"),
12        ((192, 192, 192), "#ffffff"),
13        ((128, 128, 128), "#ffffff"),
14        ((128, 0, 0), "#000000"),
15        ((255, 0, 0), "#000000"),
16        ((128, 128, 0), "#000000"),
17        ((255, 255, 0), "#ffffff"),
18        ((0, 128, 0), "#000000"),
19        ((0, 255, 0), "#ffffff"),
20        ((0, 128, 128), "#000000"),
21        ((0, 255, 255), "#ffffff"),
22        ((0, 0, 128), "#000000"),
23        ((0, 0, 255), "#000000"),
24        ((128, 0, 128), "#000000"),
25        ((255, 0, 255), "#000000"),
26        # Increasing the threshold means more colors will be black
27        ((255, 0, 255), "#000000", ['-t 240']),
28        ((192, 192, 192), "#000000", ['-t 240']),
29        # Decreasing the threshold means more colors will be white
30        ((255, 0, 255), "#ffffff", ['-t 80']),
31        ((192, 192, 192), "#ffffff", ['-t 80']),
32    ]
33