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

ColoredMetal

public static readonly ColorScheme ColoredMetal

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

GraysCeramics

public static readonly ColorScheme GraysCeramics

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

ModernPastel

public static readonly ColorScheme ModernPastel

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

RedsPinks

public static readonly ColorScheme RedsPinks

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

SheetMetal

public static readonly ColorScheme SheetMetal

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

WarmDarkMutedPastels

public static readonly ColorScheme WarmDarkMutedPastels

Field Value

ColorScheme

Water

public static readonly ColorScheme Water

Field Value

ColorScheme

White

public static readonly ColorScheme White

Field Value

ColorScheme

WhiteGradient

public static readonly ColorScheme WhiteGradient

Field Value

ColorScheme

Properties

Count

Returns 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

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.

WithTransparent()

Returns a copy of this color scheme, but with the Transparent color scheme prepended to it. This is useful when you want to allow for an object layer to optionally be invisible.

public ColorScheme WithTransparent()

Returns

ColorScheme

A copy of this color scheme, but with a transparent option prepended.