Table of Contents

Class ColorScheme

Namespace
TinyLife.Utilities
Assembly
Tiny Life.dll

A color scheme is a list of Microsoft.Xna.Framework.Color instances with which an object can be colored. By default, a set of color schemes exist (defined in this class), but new ones can be created easily using Create(params object[]).

public class ColorScheme : IReadOnlyCollection<Color>, IEnumerable<Color>, IEnumerable
Inheritance
ColorScheme
Implements
Inherited Members
Extension Methods

Fields

Bricks

public static readonly ColorScheme Bricks

Field Value

ColorScheme

CardboardBoxes

public static readonly ColorScheme CardboardBoxes

Field Value

ColorScheme

Ceramics

public static readonly ColorScheme Ceramics

Field Value

ColorScheme

ColoredConcrete

public static readonly ColorScheme ColoredConcrete

Field Value

ColorScheme

Dirt

public static readonly ColorScheme Dirt

Field Value

ColorScheme

DirtPaths

public static readonly ColorScheme DirtPaths

Field Value

ColorScheme

DyedWood

public static readonly ColorScheme DyedWood

Field Value

ColorScheme

Eyes

public static readonly ColorScheme Eyes

Field Value

ColorScheme

Flannel

public static readonly ColorScheme Flannel

Field Value

ColorScheme

Grays

public static readonly ColorScheme Grays

Field Value

ColorScheme

Hair

public static readonly ColorScheme Hair

Field Value

ColorScheme

Jewelery

public static readonly ColorScheme Jewelery

Field Value

ColorScheme

Khakis

public static readonly ColorScheme Khakis

Field Value

ColorScheme

Modern

public static readonly ColorScheme Modern

Field Value

ColorScheme

ModernShort

public static readonly ColorScheme ModernShort

Field Value

ColorScheme

MutedPastels

public static readonly ColorScheme MutedPastels

Field Value

ColorScheme

Pastel

public static readonly ColorScheme Pastel

Field Value

ColorScheme

Plants

public static readonly ColorScheme Plants

Field Value

ColorScheme

RetroAppliances

public static readonly ColorScheme RetroAppliances

Field Value

ColorScheme

RetroTv

public static readonly ColorScheme RetroTv

Field Value

ColorScheme

Rugs

public static readonly ColorScheme Rugs

Field Value

ColorScheme

Sand

public static readonly ColorScheme Sand

Field Value

ColorScheme

SimpleWood

public static readonly ColorScheme SimpleWood

Field Value

ColorScheme

Skin

public static readonly ColorScheme Skin

Field Value

ColorScheme

Thatch

public static readonly ColorScheme Thatch

Field Value

ColorScheme

Transparent

public static readonly ColorScheme Transparent

Field Value

ColorScheme

TrashCanTypes

public static readonly ColorScheme TrashCanTypes

Field Value

ColorScheme

TreeBaubles

public static readonly ColorScheme TreeBaubles

Field Value

ColorScheme

TreeTinsel

public static readonly ColorScheme TreeTinsel

Field Value

ColorScheme

WarmDark

public static readonly ColorScheme WarmDark

Field Value

ColorScheme

Water

public static readonly ColorScheme Water

Field Value

ColorScheme

White

public static readonly ColorScheme White

Field Value

ColorScheme

Properties

Count

Stores the amount of Microsoft.Xna.Framework.Color instances that are part of this color scheme

public int Count { get; }

Property Value

int

this[int]

Returns the Microsoft.Xna.Framework.Color at the given index in this color scheme

public Color this[int index] { get; }

Parameters

index int

The index to return the color for

Property Value

Color

Methods

Combine(ColorScheme, ColorScheme)

Combines two color schemes into a new color scheme that contains all of the colors from both schemes. If both color scheme contain any of the same colors, only one of them will be added to the new color scheme. Note that the operator +(ColorScheme, ColorScheme) operator can also be used for this purpose. Also note that a given color scheme can be modified permanently using MergeWith(ColorScheme).

public static ColorScheme Combine(ColorScheme left, ColorScheme right)

Parameters

left ColorScheme

The left color scheme

right ColorScheme

The right color scheme

Returns

ColorScheme

A new, combined color scheme

Create(params object[])

Create a new color scheme from the given colors. The colors passed can be of type Microsoft.Xna.Framework.Color, int or uint.

public static ColorScheme Create(params object[] objs)

Parameters

objs object[]

The colors that this color scheme should contain

Returns

ColorScheme

A new color scheme with the given colors

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<Color> GetEnumerator()

Returns

IEnumerator<Color>

An enumerator that can be used to iterate through the collection.

Load(TextureRegion)

Loads a color scheme from the given texture region. Each pixel on the texture region is evaluated and any pixels with an alpha value greater than zero are added to the color scheme.

public static ColorScheme Load(TextureRegion region)

Parameters

region TextureRegion

The texture region to turn into a color scheme

Returns

ColorScheme

A color scheme with the colors from the texture region

MergeWith(ColorScheme)

Merges this color scheme with the colors of the given ColorScheme. This method essentially adds the colors from other to this color scheme's colors. The other color scheme is not affected by this action.

public void MergeWith(ColorScheme other)

Parameters

other ColorScheme

The color scheme to merge this color scheme with.

Multiply(ColorScheme, Color)

public static ColorScheme Multiply(ColorScheme scheme, Color color)

Parameters

scheme ColorScheme
color Color

Returns

ColorScheme

Multiply(ColorScheme, float)

public static ColorScheme Multiply(ColorScheme scheme, float percentage)

Parameters

scheme ColorScheme
percentage float

Returns

ColorScheme

Operators

operator +(ColorScheme, ColorScheme)

Combines two color schemes into a new color scheme that contains all of the colors from both schemes. If both color scheme contain any of the same colors, only one of them will be added to the new color scheme. Note that the operator +(ColorScheme, ColorScheme) operator can also be used for this purpose. Also note that a given color scheme can be modified permanently using MergeWith(ColorScheme).

public static ColorScheme operator +(ColorScheme left, ColorScheme right)

Parameters

left ColorScheme

The left color scheme

right ColorScheme

The right color scheme

Returns

ColorScheme

A new, combined color scheme

operator *(ColorScheme, Color)

public static ColorScheme operator *(ColorScheme scheme, Color color)

Parameters

scheme ColorScheme
color Color

Returns

ColorScheme

operator *(ColorScheme, float)

public static ColorScheme operator *(ColorScheme scheme, float percentage)

Parameters

scheme ColorScheme
percentage float

Returns

ColorScheme