kivymd / KivyMD

KivyMD is a collection of Material Design compliant widgets for use with Kivy, a framework for cross-platform, touch-enabled graphical applications. https://youtube.com/c/KivyMD https://twitter.com/KivyMD https://habr.com/ru/users/kivymd https://stackoverflow.com/tags/kivymd
https://kivymd.readthedocs.io
MIT License
2.21k stars 665 forks source link

Fix the examples in the documentation for the `Dynamic color` module #1653

Open HeaTTheatR opened 6 months ago

HeaTTheatR commented 6 months ago

Fix the examples in the documentation for the Dynamic color module https://kivymd.readthedocs.io/en/latest/components/dynamic-color/#example-of-dynamic-color-from-the-list-of-standard-color-schemes

rhandel commented 2 months ago

Does this also include the example code errors in dynamic_color_image.py? I get this error:

File "E:...\Kivy2406\examples\dynamic_color_image.py", line 78, in generate_cards for name_color in self.theme_cls.current_schemes_color_data: AttributeError: 'ThemeManager' object has no attribute 'current_schemes_color_data'

...

def generate_cards(self, *args):
    self.root.ids.card_list.data = []
    for name_color in self.theme_cls.current_schemes_color_data:
            self.root.ids.card_list.data.append(
            {
                "bg_color": getattr(self.theme_cls, name_color),
                "text": name_color,
            }
        )

...

It seems that current_schemes_color_data is not an attribute of ThemeManager. Is there supposed to be a way to get all of the colors in a Theme?

It looks as though the code excerpt in the documentation and dynamic_color_image.py is VERY similar and commits the same error.

RAH