|
Player12
An open source football management simulator
|
Design tokens shared by every management screen. More...
Namespaces | |
| namespace | Space |
| Spacing scale in unscaled pixels. | |
Classes | |
| struct | Appearance |
| User-selected appearance options. More... | |
| struct | Palette |
| Semantic colours used by widgets. More... | |
| class | ScopedText |
| Pushes a typography level for the lifetime of the object. More... | |
| struct | Swatch |
| Representative colours of a preset, for previews. More... | |
Enumerations | |
| enum class | Text : uint8_t { CAPTION , SMALL , BODY , TITLE , HEADING , DISPLAY } |
| Typography scale. More... | |
| enum class | Preset : uint8_t { DARK_SLATE , MIDNIGHT_BLUE , PITCH_GREEN , LIGHT , HIGH_CONTRAST , TRUE_DARK , COUNT } |
| Built-in palettes. More... | |
| enum class | ColorVision : uint8_t { STANDARD , RED_GREEN , BLUE_YELLOW , COUNT } |
| Hues of the status colours. Good and bad are never told apart by red against green alone in the safe modes. More... | |
Functions | |
| Palette | presetPalette (Preset preset, ColorVision vision, const ImVec4 &accent) |
| Palette of a preset without applying it (no ImGui state touched), e.g. for previews and contrast checks. | |
| const char * | colorVisionKey (ColorVision vision) |
| Localisation key of a colour-vision mode's name. | |
| float | contrastRatio (const ImVec4 &first, const ImVec4 &second) |
| WCAG contrast ratio of two opaque colours (1 to 21). | |
| const Palette & | palette () |
| Returns the active palette (accent included). | |
| const Appearance & | appearance () |
| Returns the active appearance options. | |
| void | apply (const Appearance &options, float displayScale) |
| Applies an appearance to the current ImGui style. | |
| void | setClub (std::optional< TeamID > teamId) |
| Tells the theme which club is managed (for club accents). | |
| float | scale () |
| Effective UI scale (fonts and sizes). | |
| bool | reducedMotion () |
| True when animations should be avoided. | |
| Swatch | presetSwatch (Preset preset) |
| Preview colours of a preset without applying it. | |
| const char * | presetKey (Preset preset) |
| Localisation key of a preset name. | |
| ImVec4 | clubAccent (TeamID teamId) |
| Deterministic accent colour for a club. | |
| ImVec4 | ratingColor (double value) |
| Continuous colour scale for 0-100 ratings (red to green). | |
| float | textSize (Text level) |
| Unscaled pixel size for a typography level. | |
| ImU32 | toU32 (const ImVec4 &color, float alpha=1.0f) |
| Converts a colour with an optional alpha multiplier. | |
| uint32_t | packRgb (const ImVec4 &color) |
| Packs an opaque colour as 0xRRGGBB (for settings files). | |
| ImVec4 | unpackRgb (uint32_t rgb) |
| Unpacks 0xRRGGBB into an opaque colour. | |
Design tokens shared by every management screen.
A theme is a preset palette plus one accent colour (the managed club's or a custom one). Typography uses the one bundled TTF at several sizes through ImGui's dynamic font atlas, and a small spacing scale keeps rhythm consistent between screens. Everything is re-applied live when the user changes appearance settings or the window moves to another display.
|
strong |
|
strong |
|
strong |
| const Appearance & Theme::appearance | ( | ) |
Returns the active appearance options.
| void Theme::apply | ( | const Appearance & | options, |
| float | displayScale | ||
| ) |
Applies an appearance to the current ImGui style.
| options | Preset, accent, scale and density choices. |
| displayScale | Display content scale used when ui_scale is automatic. |
| ImVec4 Theme::clubAccent | ( | TeamID | teamId | ) |
Deterministic accent colour for a club.
| const char * Theme::colorVisionKey | ( | ColorVision | vision | ) |
Localisation key of a colour-vision mode's name.
| float Theme::contrastRatio | ( | const ImVec4 & | first, |
| const ImVec4 & | second | ||
| ) |
WCAG contrast ratio of two opaque colours (1 to 21).
| uint32_t Theme::packRgb | ( | const ImVec4 & | color | ) |
Packs an opaque colour as 0xRRGGBB (for settings files).
| const Palette & Theme::palette | ( | ) |
Returns the active palette (accent included).
| const char * Theme::presetKey | ( | Preset | preset | ) |
Localisation key of a preset name.
| Palette Theme::presetPalette | ( | Preset | preset, |
| ColorVision | vision, | ||
| const ImVec4 & | accent | ||
| ) |
Palette of a preset without applying it (no ImGui state touched), e.g. for previews and contrast checks.
| ImVec4 Theme::ratingColor | ( | double | value | ) |
Continuous colour scale for 0-100 ratings (red to green).
| bool Theme::reducedMotion | ( | ) |
True when animations should be avoided.
| float Theme::scale | ( | ) |
Effective UI scale (fonts and sizes).
| void Theme::setClub | ( | std::optional< TeamID > | teamId | ) |
Tells the theme which club is managed (for club accents).
| float Theme::textSize | ( | Text | level | ) |
Unscaled pixel size for a typography level.
| ImU32 Theme::toU32 | ( | const ImVec4 & | color, |
| float | alpha | ||
| ) |
Converts a colour with an optional alpha multiplier.
| ImVec4 Theme::unpackRgb | ( | uint32_t | rgb | ) |
Unpacks 0xRRGGBB into an opaque colour.