Merge branch 'main' into fix/tree-tooltip-fallback
Some checks failed
Build and Test / build (pull_request) Has been cancelled
Some checks failed
Build and Test / build (pull_request) Has been cancelled
This commit is contained in:
@@ -42,7 +42,13 @@ using namespace Gui;
|
||||
static QString chipStyle(const QString& bgHex)
|
||||
{
|
||||
QColor bg(bgHex);
|
||||
QColor textColor(QStringLiteral("#cdd6f4")); // Catppuccin Text
|
||||
|
||||
// Choose text color based on background luminance (WCAG relative luminance)
|
||||
// Dark text on bright backgrounds, light text on dark backgrounds
|
||||
double luminance = 0.2126 * bg.redF() + 0.7152 * bg.greenF() + 0.0722 * bg.blueF();
|
||||
QColor textColor(luminance > 0.5
|
||||
? QStringLiteral("#1e1e2e") // Catppuccin Base (dark)
|
||||
: QStringLiteral("#cdd6f4")); // Catppuccin Text (light)
|
||||
|
||||
return QStringLiteral(
|
||||
"QToolButton {"
|
||||
|
||||
Reference in New Issue
Block a user