【发布时间】:2017-04-19 16:35:52
【问题描述】:
如何在我制作的 kivy Paint 应用程序中更改线条颜色。我可以改变线条的宽度,但我找不到任何改变线条颜色的东西。
我的代码:
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.graphics import Line
class DrawRandom(Widget):
def on_touch_down(self, touch):
with self.canvas:
touch.ud["line"]=Line(points=(touch.x,touch.y),width=5)
def on_touch_move(self, touch):
touch.ud["line"].points += (touch.x, touch.y)
class PaintApp(App):
def build(self):
return DrawRandom()
if __name__ == "__main__":
PaintApp().run()
【问题讨论】:
标签: python python-2.7 kivy kivy-language