#2496 Displays use complementary color for aliases in dark mode (#2548)

Co-authored-by: denny <dennis.sheirer@gmail.com>
This commit is contained in:
Denny Sheirer
2026-11-01 05:38:48 -05:00
committed by GitHub
parent 197cec04f3
commit 7b249af944
6 changed files with 208 additions and 3 deletions

View File

@@ -221,6 +221,18 @@ public class ThemeManager
return mCurrentTheme != null && mCurrentTheme.isDark();
}
/**
* Provides the color to render user-selected content (e.g. an alias) against a background in the current theme.
* @param color selected by the user.
* @param background that the color is rendered against.
* @return the color, or a readable alternative when dark mode is active and the color lacks contrast with the
* background.
*/
public Color getReadableColor(Color color, Color background)
{
return isDarkMode() ? ColorContrast.getReadable(color, background) : color;
}
public void register(Scene scene)
{
if(scene == null)