用法:
turtle.colormode(cmode=None)
cmode- 值 1.0 或 255 之一
參數:
返回顏色模式或將其設置為 1.0 或 255。隨後,顏色三元組的
r
,g
,b
值必須在 0..cmode
範圍內。>>> screen.colormode(1) >>> turtle.pencolor(240, 160, 80) Traceback (most recent call last): ... TurtleGraphicsError: bad color sequence: (240, 160, 80) >>> screen.colormode() 1.0 >>> screen.colormode(255) >>> screen.colormode() 255 >>> turtle.pencolor(240,160,80)
相關用法
- Python turtle.colormode()用法及代碼示例
- Python turtle.color用法及代碼示例
- Python turtle.color()用法及代碼示例
- Python turtle.circle()用法及代碼示例
- Python turtle.clearstamps用法及代碼示例
- Python turtle.clearstamp用法及代碼示例
- Python turtle.clear()用法及代碼示例
- Python turtle.clearstamp()用法及代碼示例
- Python turtle.circle用法及代碼示例
- Python turtle.clone()用法及代碼示例
- Python turtle.clearstamps()用法及代碼示例
- 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.org大神的英文原創作品 turtle.colormode。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。