ThemableColor
Color value that can originate from a theme or a local override and be resolved to an actual color.
Definition
Namespace:Telerik.Windows.Documents.Spreadsheet.Model
Assembly:Telerik.Windows.Documents.Core.dll
Syntax:
[TypeConverter(typeof(ThemableColorTypeConverter))]
public class ThemableColor : IThemableObject<Color>
Inheritance: objectThemableColor
Implements:
Constructors
Initializes a new instance of the ThemableColor class with a concrete color and an automatic flag.
public ThemableColor(Color color, bool isAutomatic)
The color.
isAutomaticboolThe is automatic.
Initializes a new instance of the ThemableColor class with a concrete color value.
public ThemableColor(Color color)
The color.
Initializes a new instance that references a theme color and optional shade step.
public ThemableColor(ThemeColorType themeColorType, ColorShadeType? colorShadeType = null)
The theme color type.
colorShadeTypeColorShadeType?The color shade type.
Initializes a new instance that references a theme color with a tint/shade adjustment in [-1, 1].
public ThemableColor(ThemeColorType themeColorType, double tintAndShade)
Theme color type.
tintAndShadedoubleThe tint and shade.
Methods
Convert a Color to a ThemableColor.
public static ThemableColor FromColor(Color value)
The Color.
Returns:The ThemableColor.
Resolve the effective color using the specified theme.
public Color GetActualValue(DocumentTheme theme)
The theme.
Returns:Color
The actual value.
Implements:
Resolve the effective color using the provided color scheme.
public Color GetActualValue(ThemeColorScheme colorScheme)
The color scheme.
Returns:Color
The actual color.
Operators
Explicitly cast a concrete color to a themable color instance.
public static explicit operator ThemableColor(Color value)
The color.
Returns:Themable color.
Compare two themable colors for inequality.
public static bool operator !=(ThemableColor first, ThemableColor second)
The first themable color.
secondThemableColorThe second themable color.
Returns:If the two themable colors are equal.
Compare two themable colors for value equality.
public static bool operator ==(ThemableColor first, ThemableColor second)
The first themable color.
secondThemableColorThe second themable color.
Returns:If the two themable colors are equal.
Properties
Gets the shade step used to derive a lighter/darker variant when the color references a theme.
public ColorShadeType? ColorShadeType { get; }
The color shade type.
Gets whether the color is marked as automatic, allowing consumers to adjust it as appropriate.
public bool IsAutomatic { get; }
Value indicating if the color is automatic.
Gets whether the color is resolved from the theme rather than a local color.
public bool IsFromTheme { get; }
The value indicating if the instance is from a theme.
Implements:
LocalValue
Color
Gets the locally assigned color used when the value does not come from the theme.
public Color LocalValue { get; }
Implements:
Gets the referenced theme color type when the value comes from the theme.
public ThemeColorType ThemeColorType { get; }
The theme color type.
Gets the tint/shade adjustment in the range [-1, 1] when explicitly specified.
public double? TintAndShade { get; }
The tint and shade.