From 781f37b2a41c07d45d53a92cd5fd8a346e1df1d8 Mon Sep 17 00:00:00 2001 From: Christian Daniel Jensen Date: Mon, 2 Nov 2026 05:57:57 -0700 Subject: [PATCH] Preserve readable colors for non-Essence categories in shared chart components --- cockatrice/src/interface/essence_chart_colors.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/interface/essence_chart_colors.h b/cockatrice/src/interface/essence_chart_colors.h index 12ae8cd25..91e580e89 100644 --- a/cockatrice/src/interface/essence_chart_colors.h +++ b/cockatrice/src/interface/essence_chart_colors.h @@ -20,7 +20,13 @@ inline QColor colorFor(const QString &code) } const int index = Essence::symbols().indexOf(code); if (index < 0) { - return QColor(145, 149, 156); + // These charts are also reused for card types/categories. Retain + // distinct readable visualization colors without assigning Essence lore. + const QColor recognizedColor(code); + if (recognizedColor.isValid()) { + return recognizedColor; + } + return QColor::fromHsv(static_cast(qHash(code) % 360u), 110, 195); } return QColor::fromHsv((index * 137) % 360, 125, 210); }