Show / Hide Table of Contents

Class Colors

Default colors used by control themes.

Inheritance
object
Colors
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: SadConsole.UI
Assembly: SadConsole.dll
Syntax
public class Colors

Constructors

Colors()

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

Declaration
public Colors()

Colors(int)

Internal constructor to avoid creating any predefined colors.

Declaration
protected Colors(int _)
Parameters
Type Name Description
int _

Discarded parameter

Properties

Appearance_ControlDisabled

The appearance of a control when in the disabled state.

Declaration
public ColoredGlyphBase Appearance_ControlDisabled { get; set; }
Property Value
Type Description
ColoredGlyphBase

Appearance_ControlFocused

The appearance of a control when in the focused state.

Declaration
public ColoredGlyphBase Appearance_ControlFocused { get; set; }
Property Value
Type Description
ColoredGlyphBase

Appearance_ControlMouseDown

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

Declaration
public ColoredGlyphBase Appearance_ControlMouseDown { get; set; }
Property Value
Type Description
ColoredGlyphBase

Appearance_ControlNormal

The appearance of a control when in the normal state.

Declaration
public ColoredGlyphBase Appearance_ControlNormal { get; set; }
Property Value
Type Description
ColoredGlyphBase

Appearance_ControlOver

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

Declaration
public ColoredGlyphBase Appearance_ControlOver { get; set; }
Property Value
Type Description
ColoredGlyphBase

Appearance_ControlSelected

The appearance of a control when in the selected state.

Declaration
public ColoredGlyphBase Appearance_ControlSelected { get; set; }
Property Value
Type Description
ColoredGlyphBase

Black

The black color.

Declaration
public Color Black { get; set; }
Property Value
Type Description
Color

Blue

The blue color.

Declaration
public Color Blue { get; set; }
Property Value
Type Description
Color

BlueDark

The dark blue color.

Declaration
public Color BlueDark { get; set; }
Property Value
Type Description
Color

Bronze

The bronze color.

Declaration
public Color Bronze { get; set; }
Property Value
Type Description
Color

BronzeDark

The dark bronze color.

Declaration
public Color BronzeDark { get; set; }
Property Value
Type Description
Color

Brown

The brown color.

Declaration
public Color Brown { get; set; }
Property Value
Type Description
Color

BrownDark

The dark brown color.

Declaration
public Color BrownDark { get; set; }
Property Value
Type Description
Color

ControlBackgroundDisabled

Color of a control's background in disabled state.

Declaration
public AdjustableColor ControlBackgroundDisabled { get; set; }
Property Value
Type Description
AdjustableColor

ControlBackgroundFocused

Color of a control's background in focused state.

Declaration
public AdjustableColor ControlBackgroundFocused { get; set; }
Property Value
Type Description
AdjustableColor

ControlBackgroundMouseDown

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

Declaration
public AdjustableColor ControlBackgroundMouseDown { get; set; }
Property Value
Type Description
AdjustableColor

ControlBackgroundMouseOver

Color of a control's background in normal state.

Declaration
public AdjustableColor ControlBackgroundMouseOver { get; set; }
Property Value
Type Description
AdjustableColor

ControlBackgroundNormal

Color of a control's background in normal state.

Declaration
public AdjustableColor ControlBackgroundNormal { get; set; }
Property Value
Type Description
AdjustableColor

ControlBackgroundSelected

Color of a control's background in selected state.

Declaration
public AdjustableColor ControlBackgroundSelected { get; set; }
Property Value
Type Description
AdjustableColor

ControlForegroundDisabled

Color of a control's foreground in disabled state.

Declaration
public AdjustableColor ControlForegroundDisabled { get; set; }
Property Value
Type Description
AdjustableColor

ControlForegroundFocused

Color of a control's foreground in focused state.

Declaration
public AdjustableColor ControlForegroundFocused { get; set; }
Property Value
Type Description
AdjustableColor

ControlForegroundMouseDown

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

Declaration
public AdjustableColor ControlForegroundMouseDown { get; set; }
Property Value
Type Description
AdjustableColor

ControlForegroundMouseOver

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

Declaration
public AdjustableColor ControlForegroundMouseOver { get; set; }
Property Value
Type Description
AdjustableColor

ControlForegroundNormal

Color of a control's foreground in normal state.

Declaration
public AdjustableColor ControlForegroundNormal { get; set; }
Property Value
Type Description
AdjustableColor

ControlForegroundSelected

Color of a control's foreground in selected state.

Declaration
public AdjustableColor ControlForegroundSelected { get; set; }
Property Value
Type Description
AdjustableColor

ControlHostBackground

Color of the control host's background.

Declaration
public AdjustableColor ControlHostBackground { get; set; }
Property Value
Type Description
AdjustableColor

ControlHostForeground

Color of the control host's foreground.

Declaration
public AdjustableColor ControlHostForeground { get; set; }
Property Value
Type Description
AdjustableColor

Cyan

The cyan color.

Declaration
public Color Cyan { get; set; }
Property Value
Type Description
Color

CyanDark

The dark cyan color.

Declaration
public Color CyanDark { get; set; }
Property Value
Type Description
Color

Default

The default colors used by controls and your code.

Declaration
public static Colors Default { get; set; }
Property Value
Type Description
Colors

Gold

The gold color.

Declaration
public Color Gold { get; set; }
Property Value
Type Description
Color

GoldDark

The dark gold color.

Declaration
public Color GoldDark { get; set; }
Property Value
Type Description
Color

Gray

The gray color.

Declaration
public Color Gray { get; set; }
Property Value
Type Description
Color

GrayDark

The dark gray color.

Declaration
public Color GrayDark { get; set; }
Property Value
Type Description
Color

Green

The green color.

Declaration
public Color Green { get; set; }
Property Value
Type Description
Color

GreenDark

The dark green color.

Declaration
public Color GreenDark { get; set; }
Property Value
Type Description
Color

IsLightTheme

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

Declaration
public bool IsLightTheme { get; set; }
Property Value
Type Description
bool

Lines

Color used in drawing lines.

Declaration
public AdjustableColor Lines { get; set; }
Property Value
Type Description
AdjustableColor

ModalBackground

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

Declaration
public Color ModalBackground { get; set; }
Property Value
Type Description
Color

Name

The name of this color scheme.

Declaration
public string Name { get; set; }
Property Value
Type Description
string

Orange

The orange color.

Declaration
public Color Orange { get; set; }
Property Value
Type Description
Color

OrangeDark

The dark orange color.

Declaration
public Color OrangeDark { get; set; }
Property Value
Type Description
Color

Purple

The purple color.

Declaration
public Color Purple { get; set; }
Property Value
Type Description
Color

PurpleDark

The dark purple color.

Declaration
public Color PurpleDark { get; set; }
Property Value
Type Description
Color

Red

The red color.

Declaration
public Color Red { get; set; }
Property Value
Type Description
Color

RedDark

The dark red color.

Declaration
public Color RedDark { get; set; }
Property Value
Type Description
Color

Silver

The silver color.

Declaration
public Color Silver { get; set; }
Property Value
Type Description
Color

SilverDark

The dark silver color.

Declaration
public Color SilverDark { get; set; }
Property Value
Type Description
Color

Title

Color used for titles.

Declaration
public AdjustableColor Title { get; set; }
Property Value
Type Description
AdjustableColor

White

The white color.

Declaration
public Color White { get; set; }
Property Value
Type Description
Color

Yellow

The yellow color.

Declaration
public Color Yellow { get; set; }
Property Value
Type Description
Color

YellowDark

The dark yellow color.

Declaration
public Color YellowDark { get; set; }
Property Value
Type Description
Color

Methods

AddToColorMappings()

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

Declaration
public void AddToColorMappings()

Clone()

Returns a clone of this object.

Declaration
public Colors Clone()
Returns
Type Description
Colors

A new Colors object.

CopyTo(Colors)

Copies the colors to another color object.

Declaration
public void CopyTo(Colors colors)
Parameters
Type Name Description
Colors colors

The color object to copy to.

CreateAnsi()

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

Declaration
public static Colors CreateAnsi()
Returns
Type Description
Colors

CreateSadConsoleBlue()

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

Declaration
public static Colors CreateSadConsoleBlue()
Returns
Type Description
Colors

FromColorName(ColorNames)

Gets a color by enumeration.

Declaration
public Color FromColorName(Colors.ColorNames color)
Parameters
Type Name Description
Colors.ColorNames color

The color to get.

Returns
Type Description
Color

A color.

GetOffColor(Color, Color)

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

Declaration
public Color GetOffColor(Color inColor, Color compareColor)
Parameters
Type Name Description
Color inColor

The base color.

Color compareColor

The color to compare with.

Returns
Type Description
Color

A new color.

NormalizeBlack(Color)

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

Declaration
public static Color NormalizeBlack(Color inColor)
Parameters
Type Name Description
Color inColor

The color to check.

Returns
Type Description
Color

A new color.

RebuildAppearances()

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

Declaration
public virtual void RebuildAppearances()

SetColorByName(ColorNames, Color)

Sets a named color to a specified value.

Declaration
public void SetColorByName(Colors.ColorNames name, Color color)
Parameters
Type Name Description
Colors.ColorNames name

The name of the color.

Color color

The color value.

TryToColorName(Color, out ColorNames)

Tries to get the color name of the specified color.

Declaration
public bool TryToColorName(Color color, out Colors.ColorNames colorName)
Parameters
Type Name Description
Color color

The color to match.

Colors.ColorNames colorName

Set to the color enumeration value when the color parameter matches a defined color.

Returns
Type Description
bool

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

Extension Methods

ExtensionsSystem.GetDebuggerDisplayValue(object)
In this article

Back to top

Back to top Generated by DocFX