Esempio n. 1
0
def test_can_set_color_component_by_name():
    c = Color("red")
    c.green = 255
    assert c.components == (255, 255, 0)
    c = Color("red")
    c.green = 1.0
    assert c.components == (255, 255, 0)
Esempio n. 2
0
def test_color_name_is_reset_on_any_change():
    c = Color("red")
    assert c.name == "red"
    c.green = 255
    assert not c.name
    c = Color("red")
    c[1] = 1.0
    assert not c.name
    c = Color("red")
    c.components = (0, 1, 0)
    assert not c.name