Struct UiThemeTextStyle
The typeface and colour a theme writes its text in.
Inherited Members
Namespace: Serenity.Ui.Infrastructure.Entities
Assembly: Serenity.UnityUi.Infrastructure.dll
Syntax
public readonly struct UiThemeTextStyle
Remarks
Read from the theme's submittable template rather than declared as fields of its own. A theme already answers "what does text look like here?" — every button in it carries the answer — and asking a theme author to state it a second time in a settings block invites the two to disagree. The button is the source, so a theme cannot be styled and then contradict itself.
Fields
Color
Declaration
public readonly Color Color
Field Value
| Type | Description |
|---|---|
| Color | The theme's text colour. |
Font
Declaration
public readonly TMP_FontAsset Font
Field Value
| Type | Description |
|---|---|
| TMP_FontAsset | The theme's typeface, or null when it could not be read. |
IsResolved
Declaration
public readonly bool IsResolved
Field Value
| Type | Description |
|---|---|
| bool | Whether a theme actually answered; false means nothing was found to read. |
Methods
FromTheme(IUiThemeDefinition)
Reads the style off the theme's submittable template.
Declaration
public static UiThemeTextStyle FromTheme(IUiThemeDefinition theme)
Parameters
| Type | Name | Description |
|---|---|---|
| IUiThemeDefinition | theme | The theme to read, which may be null. |
Returns
| Type | Description |
|---|---|
| UiThemeTextStyle | The theme's text style, or an unresolved one. |
Remarks
Unresolved is a normal outcome, not an error: a project can run before any theme is installed, and a theme predating a template still has to render something. Callers fall back rather than fail.