API Reference
Class
Theme
Represents a theme containing light and dark color palettes.
Inheritance
- Object
- Theme
Constructors
Methods
GetColor 2 overloads
public String GetColor(String name) #Returns:
StringRetrieves a color by name for the current theme mode.
Parameters
- name System.String
- Color identifier.
public String GetColor(String name, ThemeMode mode) #Returns:
StringRetrieves a color by name for a specific theme mode.
Parameters
- name System.String
- Color identifier.
- mode HtmlForgeX.Email.ThemeMode
- Theme mode to resolve.
public Void SetColor(String name, String lightColor, String darkColor = null) #Returns:
VoidAdds or updates a color in the theme palettes.
Parameters
- name System.String
- Color identifier.
- lightColor System.String
- Color value for light mode.
- darkColor System.String = null
- Color value for dark mode. If null, the light color is used.
Inherited Methods
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:
StringResolves the effective color for a component, returning the theme color when the current color matches the default palette value.
Parameters
- theme HtmlForgeX.Email.Theme
- currentColor System.String
- semanticName System.String
public static String GetThemedColor(Theme theme, String lightColor, String darkColor) #Returns:
StringResolves light or dark color based on the theme's current mode.
Parameters
- theme HtmlForgeX.Email.Theme
- The theme instance.
- lightColor System.String
- Color used when theme is light.
- darkColor System.String
- Color used when theme is dark.