【发布时间】:2018-03-11 10:34:54
【问题描述】:
我从https://github.com/iconic/open-iconic下载了一堆图标 图标最初为黑色,采用 .png 格式。
我想在我的一个画布上添加一个向上的箭头。
我找到了一种导入图标的方法,但问题是我无法更改图标颜色。我可以在 Kivy 中更改图标颜色,还是需要为要使用的每种颜色创建单独的 .png 图像?
<VitalBoard>:
canvas:
Color:
rgba: 0.17, 0.89, 0.89, 1
hsv: 0.48, 0.80, 0.34
Rectangle:
pos: root.width * 2 / 3 + 20, root.height * 13 / 24 + 20
size: root.width * 2 / 6 - 10 , root.height * 9 / 24 - 20
Label:
font_size: 70
text: "0"
pos: root.width * 2 / 3 + 20, root.height * 13 / 24 + 20
size: root.width * 2 / 6 - 10 , root.height * 9 / 24 - 20
Image:
source: 'open-iconic/png/arrow-thick-top-8x.png'
pos: root.width * 2 / 3 + 20, root.height * 13 / 24 + 20
size: root.width * 2 / 6 - 10 , root.height * 9 / 24 - 20
width: 74
【问题讨论】:
-
我认为您不能在 kivy 中更改图像颜色。在将它们加载到 kivy 之前,您必须在绘图程序中更改它们。
标签: python colors icons png kivy