Class ColorScheme
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(Object[]).
Inheritance
System.Object
ColorScheme
Implements
System.Collections.Generic.IReadOnlyCollection<T><Microsoft.Xna.Framework.Color>
System.Collections.Generic.IEnumerable<T><Microsoft.Xna.Framework.Color>
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Tiny Life.dll
Syntax
public class ColorScheme : IReadOnlyCollection<Color>, IEnumerable<Color>, IEnumerable
Fields
Bricks
Declaration
public static readonly ColorScheme Bricks
Field Value
CardboardBoxes
Declaration
public static readonly ColorScheme CardboardBoxes
Field Value
Ceramics
Declaration
public static readonly ColorScheme Ceramics
Field Value
Dirt
Declaration
public static readonly ColorScheme Dirt
Field Value
DirtPaths
Declaration
public static readonly ColorScheme DirtPaths
Field Value
DyedWood
Declaration
public static readonly ColorScheme DyedWood
Field Value
Eyes
Declaration
public static readonly ColorScheme Eyes
Field Value
Flannel
Declaration
public static readonly ColorScheme Flannel
Field Value
Grays
Declaration
public static readonly ColorScheme Grays
Field Value
Hair
Declaration
public static readonly ColorScheme Hair
Field Value
Jewelery
Declaration
public static readonly ColorScheme Jewelery
Field Value
Khakis
Declaration
public static readonly ColorScheme Khakis
Field Value
Modern
Declaration
public static readonly ColorScheme Modern
Field Value
ModernShort
Declaration
public static readonly ColorScheme ModernShort
Field Value
MutedPastels
Declaration
public static readonly ColorScheme MutedPastels
Field Value
Pastel
Declaration
public static readonly ColorScheme Pastel
Field Value
Plants
Declaration
public static readonly ColorScheme Plants
Field Value
RetroAppliances
Declaration
public static readonly ColorScheme RetroAppliances
Field Value
RetroTv
Declaration
public static readonly ColorScheme RetroTv
Field Value
Rugs
Declaration
public static readonly ColorScheme Rugs
Field Value
SimpleWood
Declaration
public static readonly ColorScheme SimpleWood
Field Value
Skin
Declaration
public static readonly ColorScheme Skin
Field Value
Thatch
Declaration
public static readonly ColorScheme Thatch
Field Value
Transparent
Declaration
public static readonly ColorScheme Transparent
Field Value
TrashCanTypes
Declaration
public static readonly ColorScheme TrashCanTypes
Field Value
TreeBaubles
Declaration
public static readonly ColorScheme TreeBaubles
Field Value
TreeTinsle
Declaration
public static readonly ColorScheme TreeTinsle
Field Value
WarmDark
Declaration
public static readonly ColorScheme WarmDark
Field Value
Water
Declaration
public static readonly ColorScheme Water
Field Value
White
Declaration
public static readonly ColorScheme White
Field Value
Properties
Count
Stores the amount of Microsoft.Xna.Framework.Color instances that are part of this color scheme
Declaration
public int Count { get; }
Property Value
Type |
Description |
System.Int32 |
|
Item[Int32]
Returns the Microsoft.Xna.Framework.Color at the given index in this color scheme
Declaration
public Color this[int index] { get; }
Parameters
Type |
Name |
Description |
System.Int32 |
index |
The index to return the color for
|
Property Value
Type |
Description |
Microsoft.Xna.Framework.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 Addition(ColorScheme, ColorScheme) operator can also be used for this purpose.
Also note that a given color scheme can be modified permanently using MergeWith(ColorScheme).
Declaration
public static ColorScheme Combine(ColorScheme left, ColorScheme right)
Parameters
Returns
Type |
Description |
ColorScheme |
A new, combined color scheme
|
Create(Object[])
Create a new color scheme from the given colors.
The colors passed can be of type Microsoft.Xna.Framework.Color, System.Int32 or System.UInt32.
Declaration
public static ColorScheme Create(params object[] objs)
Parameters
Type |
Name |
Description |
System.Object[] |
objs |
The colors that this color scheme should contain
|
Returns
Type |
Description |
ColorScheme |
A new color scheme with the given colors
|
GetEnumerator()
Declaration
public IEnumerator<Color> GetEnumerator()
Returns
Type |
Description |
System.Collections.Generic.IEnumerator<T><Microsoft.Xna.Framework.Color> |
|
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.
Declaration
public static ColorScheme Load(TextureRegion region)
Parameters
Type |
Name |
Description |
MLEM.Textures.TextureRegion |
region |
The texture region to turn into a color scheme
|
Returns
Type |
Description |
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.
Declaration
public void MergeWith(ColorScheme other)
Parameters
Type |
Name |
Description |
ColorScheme |
other |
The color scheme to merge this color scheme with.
|
Operators
Addition(ColorScheme, ColorScheme)
Declaration
public static ColorScheme operator +(ColorScheme left, ColorScheme right)
Parameters
Returns
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type |
Description |
System.Collections.IEnumerator |
|
Implements
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
Extension Methods