发布网友 发布时间:2022-04-19 15:26
共1个回答
热心网友 时间:2023-09-04 21:53
Return or set pencolor and fillcolor.
Several input formats are allowed. They use 0 to 3 arguments as follows:
color()
Return the current pencolor and the current fillcolor as a pair of color specification strings or tuples as returned by pencolor() and fillcolor().
color(colorstring), color((r,g,b)), color(r,g,b)
Inputs as in pencolor(), set both, fillcolor and pencolor, to the given value.
color(colorstring1, colorstring2), color((r1,g1,b1), (r2,g2,b2))
Equivalent to pencolor(colorstring1) and fillcolor(colorstring2) and analogously if the other input format is used.
If turtleshape is a polygon, outline and interior of that polygon is drawn with the newly set colors.
>>>
>>> turtle.color("red", "green")
>>> turtle.color()
('red', 'green')
>>> color("#285078", "#a0c8f0")
>>> color()
((40.0, 80.0, 120.0), (160.0, 200.0, 240.0))
基本上计算机可以描述的颜色都有