mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-11 20:43:25 -08:00
[Icons] Author icon emphasis colors as palette roles
The emphasis levels were computed from the accent at paint time, so a theme could not vary them: every theme got the same derived strong and soft tones, and a semantic hue was pushed toward the accent whether the author wanted that or not. Give each family three authored roles instead. Icon/IconStrong/IconSoft carry the neutral glyph ink and Positive/Negative gain the same Strong and Soft companions. Emphasis becomes a lookup inside the family, and a caller that names a variant pins that level at every emphasis. The paint path returns the authored color verbatim; only the filled treatments keep their saturation floor, because carrying a disc or a fill is a treatment decision. Shipped palettes author the full ladder for both schemes; the palette editor exposes the new rows and the generator writes them. System keeps deriving its neutral ink from the platform palette, since it ships no palette of its own.
This commit is contained in:
parent
115d16a74b
commit
03a4a33ba5
21 changed files with 551 additions and 277 deletions
|
|
@ -13,6 +13,13 @@
|
|||
// set. Stored in the same palette-<scheme>.toml under an [AppColors] section
|
||||
// and editable from the palette editor, so theme authors can control colors
|
||||
// beyond what Qt's palette can express.
|
||||
//
|
||||
// The icon families carry one role per emphasis level. Icon is the neutral
|
||||
// glyph ink; IconStrong and IconSoft are its primary and quiet levels. Positive
|
||||
// and Negative follow the same pattern, so an emphasis never has to be computed
|
||||
// from a hue at paint time: the theme authors all three levels. Naming a variant
|
||||
// explicitly (`IconStrong`) pins that level; naming the family (`Icon`) lets the
|
||||
// caller's emphasis choose.
|
||||
namespace AppColor
|
||||
{
|
||||
Q_NAMESPACE
|
||||
|
|
@ -20,8 +27,15 @@ enum Role
|
|||
{
|
||||
AccentStrong,
|
||||
AccentSoft,
|
||||
Icon,
|
||||
IconStrong,
|
||||
IconSoft,
|
||||
Positive,
|
||||
PositiveStrong,
|
||||
PositiveSoft,
|
||||
Negative,
|
||||
NegativeStrong,
|
||||
NegativeSoft,
|
||||
};
|
||||
Q_ENUM_NS(Role)
|
||||
} // namespace AppColor
|
||||
|
|
@ -47,9 +61,13 @@ Q_ENUM_NS(Role)
|
|||
* @brief Fallback for an application color role when the active theme does not
|
||||
* define one.
|
||||
*
|
||||
* Accent roles return an invalid QColor because ThemeManager derives them from
|
||||
* the palette highlight. Semantic roles return an opaque default that suits the
|
||||
* scheme, so themes written before the role existed still render it.
|
||||
* Accent roles and the neutral Icon family return an invalid QColor because
|
||||
* ThemeManager derives them from the palette: the accent from the highlight,
|
||||
* the icon ink from the neutral text color plus the highlight. Semantic roles
|
||||
* return an opaque default that suits the scheme, so themes written before the
|
||||
* role existed still render it. A theme with no palette of its own (the System
|
||||
* theme) keeps deriving its icon ink from the platform palette instead of
|
||||
* pinning one scheme's colors.
|
||||
*/
|
||||
QColor defaultAppColor(AppColor::Role role, bool dark);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue