Python中根据rgb值画出颜色色块

Python中 已经有一系列rgb值了,怎么画出相应的一系列颜色色块

你题目的解答代码如下:(如有帮助,望采纳!谢谢! 点击我这个回答右上方的【采纳】按钮)

import turtle
colorlist=[(45,255,0), (150,0,255), (56,60,250), (255,0,50)]
turtle.colormode(255)
for c in colorlist:
    turtle.fillcolor(c)
    turtle.pencolor(c)
    turtle.pensize(3)
    turtle.begin_fill()
    for i in range(2):
        turtle.forward(50)
        turtle.right(90)
        turtle.forward(100)
        turtle.right(90)
    turtle.end_fill()
    turtle.up()
    turtle.forward(50)
    turtle.down()

turtle.done()

img

试试神奇的pygame
试试神奇的turtle
试试神奇的PIL