Сделал переменную для цвета.
Выдает ошибку.
.py
maincolor = VariableListProperty(.9,.0,.0,1)
.kv
BoxLayout:
size_hint: 1.0, .8
canvas:
Color:
rgba: root.maincolor
Rectangle:
size: self.size
pos: self.pos
source: 'background.png'
Error
BuilderException: Parser: File "C:\Users\sdded\Desktop\main.kv", line 54:
...
52: canvas:
53: Color:
>> 54: rgba: root.maincolor
55: Rectangle:
56: size: self.size
...
AttributeError: 'Game' object has no attribute 'maincolor'
File "C:\Users\samael\AppData\Local\Programs\Python\Python38-32\lib\site-packages\kivy\lang\builder.py", line 242, in create_handler
return eval(value, idmap), bound_list
File "C:\Users\samael\Desktop\game\kivygame\releas\main.kv", line 54, in <module>
rgba: set(root.maincolor)
File "kivy\weakproxy.pyx", line 32, in kivy.weakproxy.WeakProxy.__getattr__
File "C:\Users\samael\AppData\Local\Programs\Python\Python38-32\lib\site-packages\kivy\lang\builder.py", line 923, in _build_canvas
value, _ = create_handler(
File "C:\Users\samael\AppData\Local\Programs\Python\Python38-32\lib\site-packages\kivy\lang\builder.py", line 245, in create_handler
raise BuilderException(rule.ctx, rule.line,