def test_set_stroke_handles_lists_of_strs(using_opengl_renderer): m = OpenGLVMobject() assert m.stroke_color.hex == "#fff" m.set_stroke([BLACK, BLUE, 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)
def test_set_stroke_handles_lists_of_color_objects(using_opengl_renderer): m = OpenGLVMobject() assert m.stroke_color.hex == "#fff" m.set_stroke([Color(PURE_BLUE), Color(PURE_GREEN), Color(PURE_RED)]) 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_stroke_handles_lists_of_strs(using_opengl_renderer): m = OpenGLVMobject() assert m.stroke_color.hex == "#fff" m.set_stroke([BLACK, BLUE, GREEN]) assert m.stroke_color[0] == BLACK assert m.stroke_color[1] == BLUE assert m.stroke_color[2] == GREEN
def test_set_stroke_color(using_opengl_renderer): m = OpenGLVMobject() assert m.stroke_color.hex == "#fff" np.alltrue(m.stroke_rgba == np.array((0.0, 1.0, 0.0, 0.5))) m.set_stroke(BLACK) assert m.stroke_color.hex == "#000" np.alltrue(m.stroke_rgba == np.array((1.0, 1.0, 1.0, 1.0))) m.set_stroke(PURE_GREEN, opacity=0.5) assert m.stroke_color.hex == "#0f0" np.alltrue(m.stroke_rgba == np.array((0.0, 1.0, 0.0, 0.5)))
def test_set_stroke(using_opengl_renderer): m = OpenGLVMobject() m.set_stroke(color=C.ORANGE, width=2, opacity=0.8) assert m.stroke_width == 2 assert m.stroke_opacity == 0.8 assert m.stroke_color == Color(C.ORANGE)