Skip to content

AdjustableColor Class

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

C#
[DataContract]
public class AdjustableColor

Inheritance object

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

C#
public AdjustableColor(Color color, string name)

color SadRogue.Primitives.Color
The color.

name string
A friendly name of the color.

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

C#
public AdjustableColor(Color color, string name, Colors colors)

color SadRogue.Primitives.Color
The color.

name string
A friendly name of the color.

colors Colors
The colors to try and map to.

AdjustableColor(ColorNames, string, Colors)

Section titled “AdjustableColor(ColorNames, string, Colors)”

Creates a color that maps to a Colors color.

C#
public AdjustableColor(Colors.ColorNames color, string name, Colors colors)

color Colors.ColorNames
The predefined color.

name string
A friendly name of the color.

colors Colors
The colors used setting the BaseColor value.

The name of the color.

C#
[DataMember]
public string? Name { get; set; }

The color without brightness.

C#
[DataMember]
public Color BaseColor { get; }

The color with brightness applied.

C#
public Color ComputedColor { get; }

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

C#
[DataMember]
public bool IsCustomColor { get; set; }

The Colors mapped color when IsCustomColor is false.

C#
[DataMember]
public Colors.ColorNames UIColor { get; }

A brightness to apply to the color.

C#
[DataMember]
public Colors.Brightness Brightness { get; set; }

SetUIColor(ColorNames, Colors, Brightness)

Section titled “SetUIColor(ColorNames, Colors, Brightness)”

Maps this adjustable color to a Colors color.

C#
public void SetUIColor(Colors.ColorNames color, Colors colors, Colors.Brightness brightness)

color Colors.ColorNames
The predefined color.

colors Colors
The colors used setting the BaseColor value.

brightness Colors.Brightness
The brightness to apply to the color.

Tries to map this adjustable color to a Colors color.

C#
public void SetColor(Color color, Colors colors, Colors.Brightness brightness)

color SadRogue.Primitives.Color
The color.

colors Colors
The colors to try and map to.

brightness Colors.Brightness
The brightness to apply to the color.

Configures this adjustable color to the specified color.

C#
public void SetColor(Color color)

color SadRogue.Primitives.Color
The color.

Refreshes BaseColor using UIColor and the provided Colors object.

C#
public void RefreshUIColor(Colors colors)

colors Colors
The colors to pull a color value from.

Creates a copy of this object.

C#
public AdjustableColor Clone()

AdjustableColor
A new adjustable color object.