Skip to content

Colors Class

Default colors used by control themes.

C#
public class Colors

Inheritance object

Creates a color object based on the CreateAnsi() scheme.

C#
public Colors()

Internal constructor to avoid creating any predefined colors.

C#
protected Colors(int _)

_ int
Discarded parameter

The default colors used by controls and your code.

C#
public static Colors Default { get; set; }

Status flag to indicate that the primary backgrounds of the controls are considered light rather than dark.

C#
public bool IsLightTheme { get; set; }

The name of this color scheme.

C#
public string Name { get; set; }

The white color.

C#
public Color White { get; set; }

The black color.

C#
public Color Black { get; set; }

The gray color.

C#
public Color Gray { get; set; }

The dark gray color.

C#
public Color GrayDark { get; set; }

The red color.

C#
public Color Red { get; set; }

The green color.

C#
public Color Green { get; set; }

The blue color.

C#
public Color Blue { get; set; }

The purple color.

C#
public Color Purple { get; set; }

The yellow color.

C#
public Color Yellow { get; set; }

The orange color.

C#
public Color Orange { get; set; }

The cyan color.

C#
public Color Cyan { get; set; }

The brown color.

C#
public Color Brown { get; set; }

The dark red color.

C#
public Color RedDark { get; set; }

The dark green color.

C#
public Color GreenDark { get; set; }

The dark blue color.

C#
public Color BlueDark { get; set; }

The dark purple color.

C#
public Color PurpleDark { get; set; }

The dark yellow color.

C#
public Color YellowDark { get; set; }

The dark orange color.

C#
public Color OrangeDark { get; set; }

The dark cyan color.

C#
public Color CyanDark { get; set; }

The dark brown color.

C#
public Color BrownDark { get; set; }

The gold color.

C#
public Color Gold { get; set; }

The dark gold color.

C#
public Color GoldDark { get; set; }

The silver color.

C#
public Color Silver { get; set; }

The dark silver color.

C#
public Color SilverDark { get; set; }

The bronze color.

C#
public Color Bronze { get; set; }

The dark bronze color.

C#
public Color BronzeDark { get; set; }

The color used to darken the background when is called and IsModal is true. Defaults to (20, 20, 20, 200).

C#
public Color ModalBackground { get; set; }

Color used for titles.

C#
public AdjustableColor Title { get; set; }

Color used in drawing lines.

C#
public AdjustableColor Lines { get; set; }

Color of a control’s foreground in normal state.

C#
public AdjustableColor ControlForegroundNormal { get; set; }

Color of a control’s foreground in disabled state.

C#
public AdjustableColor ControlForegroundDisabled { get; set; }

Color of a control’s foreground in mouse-over state.

C#
public AdjustableColor ControlForegroundMouseOver { get; set; }

Color of a control’s foreground in mouse-button-down state.

C#
public AdjustableColor ControlForegroundMouseDown { get; set; }

Color of a control’s foreground in selected state.

C#
public AdjustableColor ControlForegroundSelected { get; set; }

Color of a control’s foreground in focused state.

C#
public AdjustableColor ControlForegroundFocused { get; set; }

Color of a control’s background in normal state.

C#
public AdjustableColor ControlBackgroundNormal { get; set; }

Color of a control’s background in disabled state.

C#
public AdjustableColor ControlBackgroundDisabled { get; set; }

Color of a control’s background in normal state.

C#
public AdjustableColor ControlBackgroundMouseOver { get; set; }

Color of a control’s background in mouse-button-down state.

C#
public AdjustableColor ControlBackgroundMouseDown { get; set; }

Color of a control’s background in selected state.

C#
public AdjustableColor ControlBackgroundSelected { get; set; }

Color of a control’s background in focused state.

C#
public AdjustableColor ControlBackgroundFocused { get; set; }

Color of the control host’s foreground.

C#
public AdjustableColor ControlHostForeground { get; set; }

Color of the control host’s background.

C#
public AdjustableColor ControlHostBackground { get; set; }

The appearance of a control when in the normal state.

C#
public ColoredGlyphBase Appearance_ControlNormal { get; set; }

The appearance of a control when in the disabled state.

C#
public ColoredGlyphBase Appearance_ControlDisabled { get; set; }

The appearance of a control when in the mouse-over state.

C#
public ColoredGlyphBase Appearance_ControlOver { get; set; }

The appearance of a control when in the selected state.

C#
public ColoredGlyphBase Appearance_ControlSelected { get; set; }

The appearance of a control when in the mouse-down state.

C#
public ColoredGlyphBase Appearance_ControlMouseDown { get; set; }

The appearance of a control when in the focused state.

C#
public ColoredGlyphBase Appearance_ControlFocused { get; set; }

Sets all Appearance* properties based on the existing colors and settings.

C#
public virtual void RebuildAppearances()

Compares two colors and if they match, returns a color that is lighter or darker based on if IsLightTheme.

C#
public Color GetOffColor(Color inColor, Color compareColor)

inColor SadRogue.Primitives.Color
The base color.

compareColor SadRogue.Primitives.Color
The color to compare with.

SadRogue.Primitives.Color
A new color.

Normalizes a dark color to at least R:25 G:25 B:25 A:255.

C#
public static Color NormalizeBlack(Color inColor)

inColor SadRogue.Primitives.Color
The color to check.

SadRogue.Primitives.Color
A new color.

Copies the colors to another color object.

C#
public void CopyTo(Colors colors)

colors Colors
The color object to copy to.

Gets a color by enumeration.

C#
public Color FromColorName(Colors.ColorNames color)

color Colors.ColorNames
The color to get.

SadRogue.Primitives.Color
A color.

Sets a named color to a specified value.

C#
public void SetColorByName(Colors.ColorNames name, Color color)

name Colors.ColorNames
The name of the color.

color SadRogue.Primitives.Color
The color value.

Tries to get the color name of the specified color.

C#
public bool TryToColorName(Color color, out Colors.ColorNames colorName)

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.

bool
true if the specified color matched a defined color name; otherwise false.

Adds each color here to the ColorMappings dictionary. Uses the format of “theme.property-name”.

C#
public void AddToColorMappings()

Returns a clone of this object.

C#
public Colors Clone()

Colors
A new Colors object.

Creates a new colors object with the default blue colors theme of SadConsole.

C#
public static Colors CreateSadConsoleBlue()

Colors

Creates a new colors object with a standard black-based theme.

C#
public static Colors CreateAnsi()

Colors