Reputation: 424
I have a developed kivy app in python but I have an issue: Sometimes the black background is too dark and I wonder if it's possible that in Kivy the attribute Screen
has a property that could change to negative colours, I mean, like some mobile phones that you can choose to change all the colours of the mobile to negative, solving the problem of the colours. I'm new about developing with Kivy, so I don't know about the potentiality of Kivy about solving this problem. I've been looking for a few days and I haven't found out anything. If someone knows how to fix this incovenience it would be very helpful.
Upvotes: 2
Views: 4385
Reputation: 4703
You can set background color to a certain value globally by using Window.clearcolor
:
from kivy.core.window import Window
Window.clearcolor = (.9, .9, .9, 1)
You can also set it manually per screen (or pretty much any widget) by drawing on its canvas.
<WhiteScreen@Screen>:
canvas.before:
Color:
rgba: 1, 1, 1, 1
Rectangle:
pos: self.pos
size: self.size
Or change Window.clearcolor
each time you enter a screen that needs different background, preferably overwriting on_pre_enter
method, and setting it back in on_leave
.
Upvotes: 5