HtmlForgeX

API Reference

Class

Theme

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email

Represents a theme containing light and dark color palettes.

Inheritance

  • Object
  • Theme

Constructors

public Theme() #

Creates a new instance of Theme with default palettes.

Methods

GetColor 2 overloads
public String GetColor(String name) #
Returns: String

Retrieves a color by name for the current theme mode.

Parameters

name System.String requiredposition: 0
Color identifier.
public String GetColor(String name, ThemeMode mode) #
Returns: String

Retrieves a color by name for a specific theme mode.

Parameters

name System.String requiredposition: 0
Color identifier.
mode HtmlForgeX.Email.ThemeMode requiredposition: 1
Theme mode to resolve.
public Void SetColor(String name, String lightColor, String darkColor = null) #
Returns: Void

Adds or updates a color in the theme palettes.

Parameters

name System.String requiredposition: 0
Color identifier.
lightColor System.String requiredposition: 1
Color value for light mode.
darkColor System.String = null optionalposition: 2
Color value for dark mode. If null, the light color is used.

Properties

public ThemeMode Mode { get; set; } #

Current theme mode. Defaults to System.

public ThemeMode SystemTheme { get; set; } #

Determines which palette is used when System is selected. Defaults to Light.

public IDictionary<String, String> LightPalette { get; } #

Color palette for light mode.

public IDictionary<String, String> DarkPalette { get; } #

Color palette for dark mode.

Extension Methods

public static String GetEffectiveColor(Theme theme, String currentColor, String semanticName) #
Returns: String

Resolves the effective color for a component, returning the theme color when the current color matches the default palette value.

Parameters

theme HtmlForgeX.Email.Theme requiredposition: 0
currentColor System.String requiredposition: 1
semanticName System.String requiredposition: 2
public static String GetThemedColor(Theme theme, String lightColor, String darkColor) #
Returns: String

Resolves light or dark color based on the theme's current mode.

Parameters

theme HtmlForgeX.Email.Theme requiredposition: 0
The theme instance.
lightColor System.String requiredposition: 1
Color used when theme is light.
darkColor System.String requiredposition: 2
Color used when theme is dark.