Colors Class
Definition
Section titled “Definition”Default colors used by control themes.
public class ColorsInheritance object
Constructors
Section titled “Constructors”Colors()
Section titled “Colors()”Creates a color object based on the CreateAnsi() scheme.
public Colors()Colors(int)
Section titled “Colors(int)”Internal constructor to avoid creating any predefined colors.
protected Colors(int _)Parameters
Section titled “Parameters”_ int
Discarded parameter
Properties
Section titled “Properties”Default
Section titled “Default”The default colors used by controls and your code.
public static Colors Default { get; set; }IsLightTheme
Section titled “IsLightTheme”Status flag to indicate that the primary backgrounds of the controls are considered light rather than dark.
public bool IsLightTheme { get; set; }The name of this color scheme.
public string Name { get; set; }The white color.
public Color White { get; set; }The black color.
public Color Black { get; set; }The gray color.
public Color Gray { get; set; }GrayDark
Section titled “GrayDark”The dark gray color.
public Color GrayDark { get; set; }The red color.
public Color Red { get; set; }The green color.
public Color Green { get; set; }The blue color.
public Color Blue { get; set; }Purple
Section titled “Purple”The purple color.
public Color Purple { get; set; }Yellow
Section titled “Yellow”The yellow color.
public Color Yellow { get; set; }Orange
Section titled “Orange”The orange color.
public Color Orange { get; set; }The cyan color.
public Color Cyan { get; set; }The brown color.
public Color Brown { get; set; }RedDark
Section titled “RedDark”The dark red color.
public Color RedDark { get; set; }GreenDark
Section titled “GreenDark”The dark green color.
public Color GreenDark { get; set; }BlueDark
Section titled “BlueDark”The dark blue color.
public Color BlueDark { get; set; }PurpleDark
Section titled “PurpleDark”The dark purple color.
public Color PurpleDark { get; set; }YellowDark
Section titled “YellowDark”The dark yellow color.
public Color YellowDark { get; set; }OrangeDark
Section titled “OrangeDark”The dark orange color.
public Color OrangeDark { get; set; }CyanDark
Section titled “CyanDark”The dark cyan color.
public Color CyanDark { get; set; }BrownDark
Section titled “BrownDark”The dark brown color.
public Color BrownDark { get; set; }The gold color.
public Color Gold { get; set; }GoldDark
Section titled “GoldDark”The dark gold color.
public Color GoldDark { get; set; }Silver
Section titled “Silver”The silver color.
public Color Silver { get; set; }SilverDark
Section titled “SilverDark”The dark silver color.
public Color SilverDark { get; set; }Bronze
Section titled “Bronze”The bronze color.
public Color Bronze { get; set; }BronzeDark
Section titled “BronzeDark”The dark bronze color.
public Color BronzeDark { get; set; }ModalBackground
Section titled “ModalBackground”The color used to darken the background when
public Color ModalBackground { get; set; }Color used for titles.
public AdjustableColor Title { get; set; }Color used in drawing lines.
public AdjustableColor Lines { get; set; }ControlForegroundNormal
Section titled “ControlForegroundNormal”Color of a control’s foreground in normal state.
public AdjustableColor ControlForegroundNormal { get; set; }ControlForegroundDisabled
Section titled “ControlForegroundDisabled”Color of a control’s foreground in disabled state.
public AdjustableColor ControlForegroundDisabled { get; set; }ControlForegroundMouseOver
Section titled “ControlForegroundMouseOver”Color of a control’s foreground in mouse-over state.
public AdjustableColor ControlForegroundMouseOver { get; set; }ControlForegroundMouseDown
Section titled “ControlForegroundMouseDown”Color of a control’s foreground in mouse-button-down state.
public AdjustableColor ControlForegroundMouseDown { get; set; }ControlForegroundSelected
Section titled “ControlForegroundSelected”Color of a control’s foreground in selected state.
public AdjustableColor ControlForegroundSelected { get; set; }ControlForegroundFocused
Section titled “ControlForegroundFocused”Color of a control’s foreground in focused state.
public AdjustableColor ControlForegroundFocused { get; set; }ControlBackgroundNormal
Section titled “ControlBackgroundNormal”Color of a control’s background in normal state.
public AdjustableColor ControlBackgroundNormal { get; set; }ControlBackgroundDisabled
Section titled “ControlBackgroundDisabled”Color of a control’s background in disabled state.
public AdjustableColor ControlBackgroundDisabled { get; set; }ControlBackgroundMouseOver
Section titled “ControlBackgroundMouseOver”Color of a control’s background in normal state.
public AdjustableColor ControlBackgroundMouseOver { get; set; }ControlBackgroundMouseDown
Section titled “ControlBackgroundMouseDown”Color of a control’s background in mouse-button-down state.
public AdjustableColor ControlBackgroundMouseDown { get; set; }ControlBackgroundSelected
Section titled “ControlBackgroundSelected”Color of a control’s background in selected state.
public AdjustableColor ControlBackgroundSelected { get; set; }ControlBackgroundFocused
Section titled “ControlBackgroundFocused”Color of a control’s background in focused state.
public AdjustableColor ControlBackgroundFocused { get; set; }ControlHostForeground
Section titled “ControlHostForeground”Color of the control host’s foreground.
public AdjustableColor ControlHostForeground { get; set; }ControlHostBackground
Section titled “ControlHostBackground”Color of the control host’s background.
public AdjustableColor ControlHostBackground { get; set; }Appearance_ControlNormal
Section titled “Appearance_ControlNormal”The appearance of a control when in the normal state.
public ColoredGlyphBase Appearance_ControlNormal { get; set; }Appearance_ControlDisabled
Section titled “Appearance_ControlDisabled”The appearance of a control when in the disabled state.
public ColoredGlyphBase Appearance_ControlDisabled { get; set; }Appearance_ControlOver
Section titled “Appearance_ControlOver”The appearance of a control when in the mouse-over state.
public ColoredGlyphBase Appearance_ControlOver { get; set; }Appearance_ControlSelected
Section titled “Appearance_ControlSelected”The appearance of a control when in the selected state.
public ColoredGlyphBase Appearance_ControlSelected { get; set; }Appearance_ControlMouseDown
Section titled “Appearance_ControlMouseDown”The appearance of a control when in the mouse-down state.
public ColoredGlyphBase Appearance_ControlMouseDown { get; set; }Appearance_ControlFocused
Section titled “Appearance_ControlFocused”The appearance of a control when in the focused state.
public ColoredGlyphBase Appearance_ControlFocused { get; set; }Methods
Section titled “Methods”RebuildAppearances()
Section titled “RebuildAppearances()”Sets all Appearance* properties based on the existing colors and settings.
public virtual void RebuildAppearances()GetOffColor(Color, Color)
Section titled “GetOffColor(Color, Color)”Compares two colors and if they match, returns a color that is lighter or darker based on if IsLightTheme.
public Color GetOffColor(Color inColor, Color compareColor)Parameters
Section titled “Parameters”inColor SadRogue.Primitives.Color
The base color.
compareColor SadRogue.Primitives.Color
The color to compare with.
Returns
Section titled “Returns”SadRogue.Primitives.Color
A new color.
NormalizeBlack(Color)
Section titled “NormalizeBlack(Color)”Normalizes a dark color to at least R:25 G:25 B:25 A:255.
public static Color NormalizeBlack(Color inColor)Parameters
Section titled “Parameters”inColor SadRogue.Primitives.Color
The color to check.
Returns
Section titled “Returns”SadRogue.Primitives.Color
A new color.
CopyTo(Colors)
Section titled “CopyTo(Colors)”Copies the colors to another color object.
public void CopyTo(Colors colors)Parameters
Section titled “Parameters”colors Colors
The color object to copy to.
FromColorName(ColorNames)
Section titled “FromColorName(ColorNames)”Gets a color by enumeration.
public Color FromColorName(Colors.ColorNames color)Parameters
Section titled “Parameters”color Colors.ColorNames
The color to get.
Returns
Section titled “Returns”SadRogue.Primitives.Color
A color.
SetColorByName(ColorNames, Color)
Section titled “SetColorByName(ColorNames, Color)”Sets a named color to a specified value.
public void SetColorByName(Colors.ColorNames name, Color color)Parameters
Section titled “Parameters”name Colors.ColorNames
The name of the color.
color SadRogue.Primitives.Color
The color value.
TryToColorName(Color, out ColorNames)
Section titled “TryToColorName(Color, out ColorNames)”Tries to get the color name of the specified color.
public bool TryToColorName(Color color, out Colors.ColorNames colorName)Parameters
Section titled “Parameters”color SadRogue.Primitives.Color
The color to match.
colorName Colors.ColorNames
Set to the color enumeration value when the color parameter matches a defined color.
Returns
Section titled “Returns”bool
true if the specified color matched a defined color name; otherwise false.
AddToColorMappings()
Section titled “AddToColorMappings()”Adds each color here to the ColorMappings dictionary. Uses the format of “theme.property-name”.
public void AddToColorMappings()Clone()
Section titled “Clone()”Returns a clone of this object.
public Colors Clone()Returns
Section titled “Returns”Colors
A new Colors object.
CreateSadConsoleBlue()
Section titled “CreateSadConsoleBlue()”Creates a new colors object with the default blue colors theme of SadConsole.
public static Colors CreateSadConsoleBlue()Returns
Section titled “Returns”CreateAnsi()
Section titled “CreateAnsi()”Creates a new colors object with a standard black-based theme.
public static Colors CreateAnsi()