Preserve readable colors for non-Essence categories in shared chart components

This commit is contained in:
Christian Daniel Jensen 2026-11-02 05:57:57 -07:00
parent f0adc0eaa6
commit 781f37b2a4

View file

@ -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<int>(qHash(code) % 360u), 110, 195);
}
return QColor::fromHsv((index * 137) % 360, 125, 210);
}