Kivy not responding to RGBA values

66 Views Asked by At

While giving the background color attribute in the .kv file for a button, and the value in two of the rgba fields goes above 220.0/255, it turns back to the default grey color. My code excerpt with the FloatLayout

 Button:
        size_hint : 0.95/18, 0.1
        pos_hint : {"center_x" : 0.95, "center_y" : 0.925}
        font : 40
        background_color: 1.0, 225.0/255, 228.0/255, 0
        color: 211.0/255, 54.0/255, 112.0/255, 1
        text: "Sample Text"
        halign : "center"

I tried decreasing the values of the rgb fields and its working, but it isn't giving the color above the 220.0/255 value. I tried converting it to up to two decimal float, and it is still returning the same.

1

There are 1 best solutions below

0
CobaltLithiumNitrogen On

John Anderson's comment worked for me,

self.my_button.background_normal=''
self.my_button.background_color=[1,1,1,1] 

worked perfectly to change the background of my button to white.