|
| sf::Color | background = sf::Color(20, 20, 20) |
| sf::Color | border = sf::Color(100, 100, 100) |
| sf::Color | borderFocus = sf::Color(100, 60, 200) |
| float | borderThickness = 1.5f |
| sf::Color | disabled = sf::Color(60, 60, 60) |
| sf::Color | error = sf::Color(220, 70, 70) |
| const sf::Font * | font = nullptr |
| unsigned int | fontSize = 14 |
| unsigned int | fontSizeLarge = 18 |
| unsigned int | fontSizeSmall = 11 |
| sf::Color | muted = sf::Color(120, 120, 120) |
| sf::Color | onBackground = sf::Color(220, 220, 220) |
| sf::Color | onDisabled = sf::Color(120, 120, 120) |
| sf::Color | onPrimary = sf::Color::White |
| sf::Color | onSurface = sf::Color::White |
| sf::Color | primary = sf::Color(100, 60, 200) |
| float | radius = 8.f |
| sf::Color | secondary = sf::Color(70, 130, 230) |
| float | spacing = 8.f |
| sf::Color | success = sf::Color(70, 200, 100) |
| sf::Color | surface = sf::Color(40, 40, 40) |
Universal design token set applied across all Themeable components.
A Theme is a plain struct of visual tokens — colors, typography, and spacing — that form the visual identity of a UI. Components that inherit Themeable automatically re-style themselves when the active theme changes via ThemeManager::apply().
Malena ships two built-in themes (DarkTheme and LightTheme). Custom themes are created by inheriting Theme and overriding tokens:
{
NeonTheme()
{
}
};
Universal design token set applied across all Themeable components.
Registering in a Manifest
{
public:
enum class Themes { Home, GameOver, Menu };
inline static const auto _ = [](){
set(Themes::GameOver, NeonTheme());
return 0;
}();
};
Base class for all Malena manifests.
static void set(EnumType key, const char *filepath)
Register an asset file path.
Malena default dark theme.
Light theme with clean white surfaces and purple accents.
Applying at runtime
static void apply(typename MANIFEST::Themes themeKey)
Apply a theme stored in a Manifest enum.
- See also
- ThemeManager, Themeable, DarkTheme, LightTheme
Definition at line 69 of file Theme.h.