Background Color

Note

The following classes are intended for in-house use of the library.

API - kivymd.uix.behaviors.backgroundcolorbehavior

class kivymd.uix.behaviors.backgroundcolorbehavior.BackgroundColorBehavior

Bases: kivy.uix.widget.Widget

r

The value of red in the rgba palette.

r is an BoundedNumericProperty and defaults to 1.0.

g

The value of green in the rgba palette.

g is an BoundedNumericProperty and defaults to 1.0.

b

The value of blue in the rgba palette.

b is an BoundedNumericProperty and defaults to 1.0.

a

The value of alpha channel in the rgba palette.

a is an BoundedNumericProperty and defaults to 0.0.

md_bg_color

The background color of the widget (Widget) that will be inherited from the BackgroundColorBehavior class.

For example:

Widget:
    canvas:
        Color:
            rgba: 0, 1, 1, 1
        Rectangle:
            size: self.size
            pos: self.pos

similar to code:

<MyWidget@BackgroundColorBehavior>
    md_bg_color: 0, 1, 1, 1

md_bg_color is an ReferenceListProperty and defaults to r, g, b, a.

class kivymd.uix.behaviors.backgroundcolorbehavior.SpecificBackgroundColorBehavior(**kwargs)

Bases: kivymd.uix.behaviors.backgroundcolorbehavior.BackgroundColorBehavior

background_palette

See kivymd.color_definitions.palette.

background_palette is an OptionProperty and defaults to ‘Primary’.

background_hue

See kivymd.color_definitions.hue.

background_hue is an OptionProperty and defaults to ‘500’.

specific_text_color

specific_text_color is an ListProperty and defaults to [0, 0, 0, 0.87].

specific_secondary_text_color

specific_secondary_text_color`is an :class:`~kivy.properties.ListProperty and defaults to [0, 0, 0, 0.87].