Exemplo n.º 1
0
def test_change_color_name():
    m = MTextEditor()
    m.color("red")
    assert str(m) == r"\C1;"
    m.clear()
    m.aci(0)
    assert str(m) == r"\C0;"
Exemplo n.º 2
0
def using_colors(msp, location):
    attribs = dict(ATTRIBS)
    attribs["width"] = 10.0
    editor = MTextEditor("using colors:" + NP)
    # Change colors by name: red, green, blue, yellow, cyan, magenta, white
    editor.color("red").append("RED" + NP)
    # The color stays the same until changed
    editor.append("also RED" + NP)
    # Change color by ACI (AutoCAD Color Index)
    editor.aci(3).append("GREEN" + NP)
    # Change color by RGB tuples
    editor.rgb((0, 0, 255)).append("BLUE" + NP)
    msp.add_mtext(str(editor), attribs).set_location(insert=location)
Exemplo n.º 3
0
def test_change_aci_color():
    m = MTextEditor()
    m.aci(0).aci(256)
    assert str(m) == r"\C0;\C256;"