用户:原神-FanOfA.阿粉查看:2 回复:2 评论:2 创建时间:2020-03-30T20:08:04
【作品展示】

【作品介绍】
arcade库颜色实验,前16个颜色
【作品源代码】
from arcade import *
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
SCREEN_TITLE = 'colors'
class MyDraw(arcade.Window):
def __init__(self, width, height, title):
super().__init__(width, height, title)
# 窗体初始化
self.setup()
def setup(self):
# 设置背景颜色
set_background_color(color.WHITE)
def on_draw(self):
start_render()
self.mydraw()
def mydraw(self):
x = 25
y = 575
count = 0
# 长度:16
colors = [color.AERO_BLUE, color.AFRICAN_VIOLET, color.AIR_FORCE_BLUE,
color.AIR_SUPERIORITY_BLUE, color.ALABAMA_CRIMSON, color.ALICE_BLUE,
color.ALIZARIN_CRIMSON, color.ALLOY_ORANGE, color.ALMOND, color.AMARANTH,
color.AMARANTH_PINK, color.AMARANTH_PURPLE, color.AMAZON,
color.AMBER, color.AMERICAN_ROSE, color.AMETHYST]
for i in range(16):
draw_point(x, y, colors[i], 100)
x += 50
if __name__ == '__main__':
game = MyDraw(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
run()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn
蒟蒻OIer1048576print(' '.join(['{i}*{j}={pro}'.format(i=i,j=j,pro=i*j) for i in range(1,10) for j in range(1,10) if i>=j]))点赞1
评论