def test_set_color_handles_lists_of_color_objects(using_opengl_renderer): m = OpenGLVMobject() assert m.color.hex == "#fff" m.set_color([Color(PURE_BLUE), Color(PURE_GREEN), Color(PURE_RED)]) assert m.get_colors()[0].hex == "#00f" assert m.get_colors()[1].hex == "#0f0" assert m.get_colors()[2].hex == "#f00" assert m.get_fill_colors()[0].hex == "#00f" assert m.get_fill_colors()[1].hex == "#0f0" assert m.get_fill_colors()[2].hex == "#f00" assert m.get_stroke_colors()[0].hex == "#00f" assert m.get_stroke_colors()[1].hex == "#0f0" assert m.get_stroke_colors()[2].hex == "#f00"
def test_set_color_handles_lists_of_strs(using_opengl_renderer): m = OpenGLVMobject() assert m.color.hex == "#fff" m.set_color([BLACK, BLUE, GREEN]) assert m.get_colors()[0] == Color(BLACK) assert m.get_colors()[1] == Color(BLUE) assert m.get_colors()[2] == Color(GREEN) assert m.get_fill_colors()[0] == Color(BLACK) assert m.get_fill_colors()[1] == Color(BLUE) assert m.get_fill_colors()[2] == Color(GREEN) assert m.get_stroke_colors()[0] == Color(BLACK) assert m.get_stroke_colors()[1] == Color(BLUE) assert m.get_stroke_colors()[2] == Color(GREEN)