Table of Contents

Struct ColorSettings

Namespace
TinyLife.Utilities
Assembly
Tiny Life.dll

Color settings are a collection of color schemes that can be used to color an object. They also contain a mapping of which layers should use which color schemes, and a set of default color schemes. Color settings are most notably used by FurnitureType.TypeSettings, as well as other objects in the world.

public struct ColorSettings
Inherited Members
Extension Methods

Constructors

ColorSettings(params ColorScheme[])

Creates a new color settings instance with the given color schemes.

public ColorSettings(params ColorScheme[] schemes)

Parameters

schemes ColorScheme[]

The color schemes to use.

Fields

Defaults

The default color selection for these settings. If not specified, this defaults to the first entries in each of the Schemes. This array is expected to have the same length as Schemes.

public int[] Defaults

Field Value

int[]

Map

An array of indices that determines which layers should use which color schemes. An object that uses ColorSettings will always have the same amount of texture layers as there are color map entries.

public int[] Map

Field Value

int[]

Schemes

An array of color schemes that these settings should have. If Map is not set, its value is determined automatically by the amount of color schemes supplied.

public ColorScheme[] Schemes

Field Value

ColorScheme[]

Methods

CreateRandom(Random)

Creates a random set of colors based on these color settings and the passed Random instance.

public readonly int[] CreateRandom(Random random)

Parameters

random Random

The random instance to use.

Returns

int[]

The generated colors.

Get(int[], int)

Returns the color that should be used for the given layer, based on the given color selections.

public readonly Color Get(int[] colors, int layer)

Parameters

colors int[]

The color selections.

layer int

The layer.

Returns

Color

The color to use.

Validate(ref int[])

Validates these color settings and the passed colors, ensuring that the given color selections are within the bounds of the available color schemes.

public readonly void Validate(ref int[] colors)

Parameters

colors int[]

The colors selections.