DocFX + Singulink = ♥

Struct PlayerColor

Represents a color that may copy from CustomColors.

Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
Namespace: SlugBase.DataTypes
Assembly: SlugBase.dll
Syntax
public readonly struct PlayerColor

Constructors

View Source

PlayerColor(JsonAny)

Creates a new PlayerColor from JSON.

Declaration
public PlayerColor(JsonAny json)
Parameters
Type Name Description
JsonAny json

The JSON to load.

View Source

PlayerColor(string)

Creates a new PlayerColor.

Declaration
public PlayerColor(string name)
Parameters
Type Name Description
string name

The name of the custom color to copy.

View Source

PlayerColor(Color)

Creates a new PlayerColor.

Declaration
public PlayerColor(Color color)
Parameters
Type Name Description
Color color

The color to return.

Fields

View Source

Body

The body color of SlugBaseCharacters.

Declaration
public static readonly PlayerColor Body
Field Value
Type Description
PlayerColor
View Source

Eyes

The eye color of SlugBaseCharacters.

Declaration
public static readonly PlayerColor Eyes
Field Value
Type Description
PlayerColor

Methods

View Source

GetColor(PlayerGraphics)

Gets the value of this color for a player.

Declaration
public Color? GetColor(PlayerGraphics playerGraphics)
Parameters
Type Name Description
PlayerGraphics playerGraphics

The player to get the color from.

Returns
Type Description
Color?

The custom color, or null if it was not overridden via CustomColors.

View Source

GetCustomColor(PlayerGraphics, int)

Gets a color from the "custom_colors" feature by index for the given SlugBase character graphics.

Declaration
public static Color GetCustomColor(PlayerGraphics playerGraphics, int index)
Parameters
Type Name Description
PlayerGraphics playerGraphics

The player graphics to get the color of.

int index

The index of the custom color.

Returns
Type Description
Color
Exceptions
Type Condition
ArgumentException

playerGraphics is not a SlugBaseCharacter instance, or does not have the "custom_colors" feature.

IndexOutOfRangeException

index is out of range of the "custom_colors" list.

View Source

GetCustomColor(PlayerGraphics, string)

Gets a color from the "custom_colors" feature by name for the given SlugBase character graphics.

Declaration
public static Color GetCustomColor(PlayerGraphics playerGraphics, string name)
Parameters
Type Name Description
PlayerGraphics playerGraphics

The player graphics to get the color of.

string name

The name of the custom color.

Returns
Type Description
Color
Exceptions
Type Condition
ArgumentException

playerGraphics is not a SlugBaseCharacter instance, or does not have the "custom_colors" feature.

KeyNotFoundException

No custom color was found matching name.