New to Telerik Document ProcessingStart a free 30-day trial

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:

C#
[TypeConverter(typeof(ThemableColorTypeConverter))]
public class ThemableColor : IThemableObject<Color>

Inheritance: objectThemableColor

Implements: IThemableObject<Color>

Constructors

Initializes a new instance of the ThemableColor class with a concrete color and an automatic flag.

C#
public ThemableColor(Color color, bool isAutomatic)
Parameters:colorColor

The color.

isAutomaticbool

The is automatic.

Initializes a new instance of the ThemableColor class with a concrete color value.

C#
public ThemableColor(Color color)
Parameters:colorColor

The color.

Initializes a new instance that references a theme color and optional shade step.

C#
public ThemableColor(ThemeColorType themeColorType, ColorShadeType? colorShadeType = null)
Parameters:themeColorTypeThemeColorType

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].

C#
public ThemableColor(ThemeColorType themeColorType, double tintAndShade)
Parameters:themeColorTypeThemeColorType

Theme color type.

tintAndShadedouble

The tint and shade.

Methods

Determines whether the specified object is equal to the current object.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with the current object.

Returns:

bool

True if the specified object is equal to the current object; otherwise, false.

Overrides: object.Equals(object)

Create a themable color from ARGB components.

C#
public static ThemableColor FromArgb(byte alfa, byte red, byte green, byte blue)
Parameters:alfabyte

The alfa 0 to 255.

redbyte

The red 0 to 255.

greenbyte

The green 0 to 255.

bluebyte

The blue 0 to 255.

Returns:

ThemableColor

Convert a Color to a ThemableColor.

C#
public static ThemableColor FromColor(Color value)
Parameters:valueColor

The Color.

Returns:

ThemableColor

The ThemableColor.

Resolve the effective color using the specified theme.

C#
public Color GetActualValue(DocumentTheme theme)
Parameters:themeDocumentTheme

The theme.

Returns:

Color

The actual value.

Implements: IThemableObject<Color>.GetActualValue(DocumentTheme)

Resolve the effective color using the provided color scheme.

C#
public Color GetActualValue(ThemeColorScheme colorScheme)
Parameters:colorSchemeThemeColorScheme

The color scheme.

Returns:

Color

The actual color.

Serves as a hash function for a particular type.

C#
public override int GetHashCode()
Returns:

int

A hash code for the current object.

Overrides: object.GetHashCode()

Returns a string that represents the current object.

C#
public override string ToString()
Returns:

string

A string that represents the current object.

Overrides: object.ToString()

Operators

Explicitly cast a concrete color to a themable color instance.

C#
public static explicit operator ThemableColor(Color value)
Parameters:valueColor

The color.

Returns:

ThemableColor

Themable color.

Compare two themable colors for inequality.

C#
public static bool operator !=(ThemableColor first, ThemableColor second)
Parameters:firstThemableColor

The first themable color.

secondThemableColor

The second themable color.

Returns:

bool

If the two themable colors are equal.

Compare two themable colors for value equality.

C#
public static bool operator ==(ThemableColor first, ThemableColor second)
Parameters:firstThemableColor

The first themable color.

secondThemableColor

The second themable color.

Returns:

bool

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.

C#
public ColorShadeType? ColorShadeType { get; }
Property Value:

The color shade type.

Gets whether the color is marked as automatic, allowing consumers to adjust it as appropriate.

C#
public bool IsAutomatic { get; }
Property Value:

Value indicating if the color is automatic.

Gets whether the color is resolved from the theme rather than a local color.

C#
public bool IsFromTheme { get; }
Property Value:

The value indicating if the instance is from a theme.

Implements: IThemableObject<Color>.IsFromTheme

Gets the locally assigned color used when the value does not come from the theme.

C#
public Color LocalValue { get; }

Implements: IThemableObject<Color>.LocalValue

Gets the referenced theme color type when the value comes from the theme.

C#
public ThemeColorType ThemeColorType { get; }
Property Value:

The theme color type.

Gets the tint/shade adjustment in the range [-1, 1] when explicitly specified.

C#
public double? TintAndShade { get; }
Property Value:

The tint and shade.