struct

FMiriGraphicsTheme

A game-UI theme: the named colours, fonts and metrics a .ui resolves its tokens against. Serialized as MDF under the engine's existing .theme extension, so it browses, cooks and validates like every other text asset. A screen names its theme; without one the host's project theme applies, and without that the built-in default theme — which carries exactly the colours the factory used to hardcode, so nothing an older asset authored moves.

Module
MiriGraphics
Header
#include "MiriGraphics/FMiriGraphicsTheme.h"
Namespace
Mowo

Properties

TypeNameDescription
std::stringNameDefault "Default".
std::vector<FMiriGraphicsThemeColor>Colors
std::vector<FMiriGraphicsThemeFont>Fonts
std::vector<FMiriGraphicsThemeMetric>Metrics
std::vector<FMiriGraphicsThemeRadii>Radii
std::vector<FMiriGraphicsThemeShadow>Shadows
std::vector<FMiriGraphicsThemeGradient>Gradients
std::vector<FMiriGraphicsThemeSprite>Sprites
std::vector<FMiriGraphicsThemeMotion>Motion

Public functions

ReturnsNameDescription
const FMiriGraphicsThemeColor*FindColor
const FMiriGraphicsThemeFont*FindFont
const FMiriGraphicsThemeMetric*FindMetric
const FMiriGraphicsThemeRadii*FindRadii
const FMiriGraphicsThemeShadow*FindShadow
const FMiriGraphicsThemeGradient*FindGradient
const FMiriGraphicsThemeSprite*FindSprite
const FMiriGraphicsThemeMotion*FindMotion
boolResolveColor
boolResolveMetric
voidSetColor
std::vector<std::string>ColorTokens
std::stringSerializeToMDF
boolParseFromMDF
boolLoadFromFile
boolSaveToFile
std::stringNormalizeToken"token/accent", "Assets/UI/Game.theme.accent" and "AccentColor" all name the same token: the path prefix is dropped, the rest lowercased and run through the legacy aliases the hardcoded map understood.
FMiriGraphicsThemeMakeDefault
Vec4HighContrastColorWhat a colour token reads as under the player's High Contrast UI: surfaces go black (at least 92% opaque), text goes white, and every other colour keeps its hue at full brightness and at least half the luminance of white, so it reads against the black surface.
const FMiriGraphicsTheme&Default

Function details

FindColor

C++
const FMiriGraphicsThemeColor* FindColor(const std::string& token) const

FindFont

C++
const FMiriGraphicsThemeFont* FindFont(const std::string& name) const

FindMetric

C++
const FMiriGraphicsThemeMetric* FindMetric(const std::string& name) const

FindRadii

C++
const FMiriGraphicsThemeRadii* FindRadii(const std::string& name) const

FindShadow

C++
const FMiriGraphicsThemeShadow* FindShadow(const std::string& name) const

FindGradient

C++
const FMiriGraphicsThemeGradient* FindGradient(const std::string& name) const

FindSprite

C++
const FMiriGraphicsThemeSprite* FindSprite(const std::string& name) const

FindMotion

C++
const FMiriGraphicsThemeMotion* FindMotion(const std::string& name) const

ResolveColor

C++
bool ResolveColor(const std::string& token, Vec4& out) const

ResolveMetric

C++
bool ResolveMetric(const std::string& name, float& out) const

SetColor

C++
void SetColor(const std::string& token, const Vec4& value)

ColorTokens

C++
std::vector<std::string> ColorTokens() const

SerializeToMDF

C++
std::string SerializeToMDF() const

ParseFromMDF

C++
bool ParseFromMDF(const std::string& text, std::string* outError = nullptr)

LoadFromFile

C++
bool LoadFromFile(const std::string& path, std::string* outError = nullptr)

SaveToFile

C++
bool SaveToFile(const std::string& path) const

NormalizeToken

C++
static std::string NormalizeToken(const std::string& token)

"token/accent", "Assets/UI/Game.theme.accent" and "AccentColor" all name the same token: the path prefix is dropped, the rest lowercased and run through the legacy aliases the hardcoded map understood.

MakeDefault

C++
static FMiriGraphicsTheme MakeDefault()

HighContrastColor

C++
static Vec4 HighContrastColor(const std::string& normalizedToken, const Vec4& value)

What a colour token reads as under the player's High Contrast UI: surfaces go black (at least 92% opaque), text goes white, and every other colour keeps its hue at full brightness and at least half the luminance of white, so it reads against the black surface. Tokens only — a literal colour authored in a .ui is the author's to choose.

Default

C++
static const FMiriGraphicsTheme& Default()
Generated from MiriGraphics/FMiriGraphicsTheme.h via mirigraphics.json · Dec 5, 2026Version 1.1.0