[Icons] Add Hidden and Marked semantic color families

Two game concepts had no hue of their own. Hidden information (a face-down
play, peeking at a card face) now has violet, and the marks a player leaves on a
card (annotation, draw arrow) now share amber instead of splitting blue and red
for the same job.

Both families follow the existing three-level ladder: authored roles per theme,
scheme defaults otherwise, an emphasis mapping, palette-editor rows and generator
seeding. The defaults clear the 4.5:1 floor on the representative platform
surfaces and keep the saturation ordering the emphasis tests assert; the hue
tests pin violet's blue-red-green dominance and amber's red-green-blue one, and
every preview sheet now renders the two families.

The hover panel grid preview is added alongside: it renders the real pages
(section headers, two-column cells, glyph over label) so the whole map can be
judged at once instead of glyph by glyph.
This commit is contained in:
Lukas Brübach 2026-11-08 20:36:21 +01:00
parent cc9c93eb57
commit 8847da74e2
10 changed files with 411 additions and 9 deletions

View file

@ -1539,7 +1539,9 @@ TEST_F(ThemeIconRenderTest, EmphasisSelectsTheAuthoredVariant)
{Family{AppColor::Icon, AppColor::IconStrong, AppColor::IconSoft},
Family{AppColor::Positive, AppColor::PositiveStrong, AppColor::PositiveSoft},
Family{AppColor::Negative, AppColor::NegativeStrong, AppColor::NegativeSoft},
Family{AppColor::Informational, AppColor::InformationalStrong, AppColor::InformationalSoft}}) {
Family{AppColor::Informational, AppColor::InformationalStrong, AppColor::InformationalSoft},
Family{AppColor::Hidden, AppColor::HiddenStrong, AppColor::HiddenSoft},
Family{AppColor::Marked, AppColor::MarkedStrong, AppColor::MarkedSoft}}) {
EXPECT_EQ(IconTint(family.base, IconEmphasis::Primary).resolve(QIcon::Normal),
themeManager->appColor(family.strong));
EXPECT_EQ(IconTint(family.base).resolve(QIcon::Normal), themeManager->appColor(family.base));
@ -1651,6 +1653,28 @@ TEST_F(ThemeIconRenderTest, EmphasisKeepsASemanticHue)
EXPECT_GT(ink.blue(), ink.red()) << theme.toStdString() << static_cast<int>(role);
EXPECT_GT(ink.blue(), ink.green()) << theme.toStdString() << static_cast<int>(role);
}
for (const AppColor::Role role : {AppColor::Hidden, AppColor::HiddenStrong, AppColor::HiddenSoft}) {
// Hidden is violet: blue leads, then red, then green.
const QColor ink = roles.value(role, defaultAppColor(role, dark));
if (!ink.isValid()) {
continue;
}
++checked;
EXPECT_GT(ink.blue(), ink.red()) << theme.toStdString() << static_cast<int>(role);
EXPECT_GT(ink.red(), ink.green()) << theme.toStdString() << static_cast<int>(role);
}
for (const AppColor::Role role : {AppColor::Marked, AppColor::MarkedStrong, AppColor::MarkedSoft}) {
// Marked is amber: red leads, then green, then blue.
const QColor ink = roles.value(role, defaultAppColor(role, dark));
if (!ink.isValid()) {
continue;
}
++checked;
EXPECT_GT(ink.red(), ink.green()) << theme.toStdString() << static_cast<int>(role);
EXPECT_GT(ink.green(), ink.blue()) << theme.toStdString() << static_cast<int>(role);
}
}
}
EXPECT_GT(checked, 0) << "no shipped theme authored a semantic emphasis level";
@ -1837,7 +1861,9 @@ TEST(IconInk, DefaultSemanticFamilyMeetsTheLadderOnPlatformSurfaces)
for (const auto &[base, strong, soft] :
{std::tuple{AppColor::Positive, AppColor::PositiveStrong, AppColor::PositiveSoft},
std::tuple{AppColor::Negative, AppColor::NegativeStrong, AppColor::NegativeSoft},
std::tuple{AppColor::Informational, AppColor::InformationalStrong, AppColor::InformationalSoft}}) {
std::tuple{AppColor::Informational, AppColor::InformationalStrong, AppColor::InformationalSoft},
std::tuple{AppColor::Hidden, AppColor::HiddenStrong, AppColor::HiddenSoft},
std::tuple{AppColor::Marked, AppColor::MarkedStrong, AppColor::MarkedSoft}}) {
const QColor secondary = defaultAppColor(base, scheme.dark);
const QColor primary = defaultAppColor(strong, scheme.dark);
const QColor quiet = defaultAppColor(soft, scheme.dark);
@ -1929,6 +1955,8 @@ TEST_F(ThemeIconRenderTest, EmphasisPreviewWritesPngsWhenRequested)
AppColor::InformationalSoft,
AppColor::Informational,
AppColor::InformationalStrong},
{"Hidden", {"view", "arrow_right", "swap"}, AppColor::HiddenSoft, AppColor::Hidden, AppColor::HiddenStrong},
{"Marked", {"pencil", "share", "pin"}, AppColor::MarkedSoft, AppColor::Marked, AppColor::MarkedStrong},
};
const QStringList themes = {
QStringLiteral("Fabric"), QStringLiteral("Fusion"), QStringLiteral("Leather"),
@ -2127,6 +2155,8 @@ TEST_F(ThemeIconRenderTest, EmphasisTreatmentsPreviewWritesPngsWhenRequested)
AppColor::InformationalSoft,
AppColor::Informational,
AppColor::InformationalStrong},
{"Hidden", {"view", "arrow_right", "swap"}, AppColor::HiddenSoft, AppColor::Hidden, AppColor::HiddenStrong},
{"Marked", {"pencil", "share", "pin"}, AppColor::MarkedSoft, AppColor::Marked, AppColor::MarkedStrong},
};
const QStringList themes = {
QStringLiteral("Fabric"), QStringLiteral("Fusion"), QStringLiteral("Leather"),