Show / Hide Table of Contents

Class AdjustableColor

A color that can be adjusted by brightness and mapped to a Colors color.

Inheritance
object
AdjustableColor
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
[DataContract]
public class AdjustableColor

Constructors

AdjustableColor(ColorNames, string, Colors)

Creates a color that maps to a Colors color.

Declaration
public AdjustableColor(Colors.ColorNames color, string name, Colors colors)
Parameters
Type Name Description
Colors.ColorNames color

The predefined color.

string name

A friendly name of the color.

Colors colors

The colors used setting the BaseColor value.

AdjustableColor(Color, string)

Creates a color that isn't mapped to a Colors color.

Declaration
public AdjustableColor(Color color, string name)
Parameters
Type Name Description
Color color

The color.

string name

A friendly name of the color.

AdjustableColor(Color, string, Colors)

Creates a color and tries to map it to a Colors color.

Declaration
public AdjustableColor(Color color, string name, Colors colors)
Parameters
Type Name Description
Color color

The color.

string name

A friendly name of the color.

Colors colors

The colors to try and map to.

Properties

BaseColor

The color without brightness.

Declaration
[DataMember]
public Color BaseColor { get; }
Property Value
Type Description
Color

Brightness

A brightness to apply to the color.

Declaration
[DataMember]
public Colors.Brightness Brightness { get; set; }
Property Value
Type Description
Colors.Brightness

ComputedColor

The color with brightness applied.

Declaration
public Color ComputedColor { get; }
Property Value
Type Description
Color

IsCustomColor

true when this color is not defined by a Colors object; otherwise false.

Declaration
[DataMember]
public bool IsCustomColor { get; set; }
Property Value
Type Description
bool

Name

The name of the color.

Declaration
[DataMember]
public string? Name { get; set; }
Property Value
Type Description
string

UIColor

The Colors mapped color when IsCustomColor is false.

Declaration
[DataMember]
public Colors.ColorNames UIColor { get; }
Property Value
Type Description
Colors.ColorNames

Methods

Clone()

Creates a copy of this object.

Declaration
public AdjustableColor Clone()
Returns
Type Description
AdjustableColor

A new adjustable color object.

RefreshUIColor(Colors)

Refreshes BaseColor using UIColor and the provided Colors object.

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

The colors to pull a color value from.

SetColor(Color)

Configures this adjustable color to the specified color.

Declaration
public void SetColor(Color color)
Parameters
Type Name Description
Color color

The color.

SetColor(Color, Colors, Brightness)

Tries to map this adjustable color to a Colors color.

Declaration
public void SetColor(Color color, Colors colors, Colors.Brightness brightness)
Parameters
Type Name Description
Color color

The color.

Colors colors

The colors to try and map to.

Colors.Brightness brightness

The brightness to apply to the color.

SetUIColor(ColorNames, Colors, Brightness)

Maps this adjustable color to a Colors color.

Declaration
public void SetUIColor(Colors.ColorNames color, Colors colors, Colors.Brightness brightness)
Parameters
Type Name Description
Colors.ColorNames color

The predefined color.

Colors colors

The colors used setting the BaseColor value.

Colors.Brightness brightness

The brightness to apply to the color.

Operators

implicit operator Color(AdjustableColor)

Casts this object to a Color.

Declaration
public static implicit operator Color(AdjustableColor color)
Parameters
Type Name Description
AdjustableColor color

The adjustable color.

Returns
Type Description
Color

Extension Methods

ExtensionsSystem.GetDebuggerDisplayValue(object)
In this article

Back to top

Back to top Generated by DocFX