我從https://github.com/iconic/open-iconic 下載了一堆圖標圖標最初是黑色的,格式爲.png。集成Kivy標籤和圖標的最佳方法
我想在畫布上添加一個向上的箭頭。
我找到了一種導入圖標的方法,但問題是我無法更改圖標顏色。我可以更改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之前,您必須在繪製程序中更改它們。 –