用法:
turtle.fillcolor(*args)
返回或設置填充顏色。
允許四種輸入格式:
fillcolor()
將當前的填充顏色作為顏色規範字符串返回,可能是元組格式(參見示例)。可用作另一個 color/pencolor/fillcolor 調用的輸入。
fillcolor(colorstring)
將 fillcolor 設置為
colorstring
,這是一個 Tk 顏色規範字符串,例如"red"
、"yellow"
或"#33cc8c"
。fillcolor((r, g, b))
將 fillcolor 設置為
r
、g
和b
的元組表示的 RGB 顏色。r
、g
和b
中的每一個都必須在 0..colormode 範圍內,其中 colormode 是 1.0 或 255(請參閱colormode()
)。fillcolor(r, g, b)
將 fillcolor 設置為
r
、g
和b
表示的 RGB 顏色。r
、g
和b
中的每一個都必須在 0..colormode 範圍內。
如果turtleshape 是一個多邊形,該多邊形的內部將使用新設置的填充顏色進行繪製。
>>> turtle.fillcolor("violet") >>> turtle.fillcolor() 'violet' >>> turtle.pencolor() (50.0, 193.0, 143.0) >>> turtle.fillcolor((50, 193, 143)) # Integers, not floats >>> turtle.fillcolor() (50.0, 193.0, 143.0) >>> turtle.fillcolor('#ffffff') >>> turtle.fillcolor() (255.0, 255.0, 255.0)
相關用法
- Python turtle.fillcolor()用法及代碼示例
- Python turtle.filling用法及代碼示例
- Python turtle.filling()用法及代碼示例
- Python turtle.forward用法及代碼示例
- Python turtle.write_docstringdict()用法及代碼示例
- Python turtle.reset用法及代碼示例
- Python turtle.delay()用法及代碼示例
- Python turtle.write()用法及代碼示例
- Python turtle.getpen()用法及代碼示例
- Python turtle.isvisible用法及代碼示例
- Python turtle.onkey用法及代碼示例
- Python turtle.tracer用法及代碼示例
- Python turtle.end_fill()用法及代碼示例
- Python turtle.undo用法及代碼示例
- Python turtle.onscreenclick()用法及代碼示例
- Python turtle.speed()用法及代碼示例
- Python turtle.up()用法及代碼示例
- Python turtle.tilt()用法及代碼示例
- Python turtle.done()用法及代碼示例
- Python turtle.isvisible()用法及代碼示例
注:本文由純淨天空篩選整理自python.org大神的英文原創作品 turtle.fillcolor。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。