def test_floor_div(): some_green = RGB(3, 99, 3) assert some_green // 3 == RGB(1, 33, 1) assert RGB(33, 188, 33) // some_green == RGB(11, 1, 11)
def test_monochrome_check(): darkest_gray = RGB(1, 1, 1) darkest_gray.is_monochrome()
def test_delta_brightness(): print('\n') print('brightness') darkest_red = RGB(1, 0, 0) print(darkest_red.brighter(39)) assert cyan.darker().brighter().brightness(normalise=False) == 254
def test_and_or(): print('\n') print('& and |') red = RGB(255, 0, 0) some_red = red & 3
def test_access_channel(): assert RGB(25, 0, 0)[0] == 25