Closed DKNorad closed 10 months ago
Yeah,
UserWarning: title font color (0, 0, 0) is equal to the menu background color (0, 0, 0, 255), consider editing your Theme
warn(
This code gives me an user warning:
theme = pygame_menu.Theme(background_color=(0, 0, 0), title_background_color=(178, 29, 29),
widget_font_color=(255, 255, 255), widget_padding=6,title_font_color = (255,255,255),
title_font_size=52,widget_font_size=38,title_bar_style = pygame_menu.widgets.MENUBAR_STYLE_UNDERLINE) #create menu theme
Error occurs if title theme is "MENUBAR_STYLE_UNDERLINE", "MENUBAR_STYLE_UNDERLINE_TITLE" or "MENUBAR_STYLE_NONE "
I found where the problem is coming from.
We are running self._menubar.set_menu(self)
in menu.py:524
before we set the font variables with self._menubar.set_font()
in menu.py:525
. We end up running self._check_title_color()
in menubar.py
before we set the self._font_color
in widget.py
, and it takes the default value which is (0, 0, 0).
Environment information Describe your environment information, such as:
Describe the bug While using a menubar style that calls self._check_title_color(background_menu=True) I get the following error when my Theme background_color is black (0, 0, 0).
To Reproduce
Expected behavior To not show the error.
Additional context I was trying to debug the problem. "_check_title_color()" gets called 3 times and this is the output from "self._font_color" with the code above.
I can't figure out why on the first call it uses the default value of (0, 0, 0) and why it goes through it 3 times.