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(params object[]).
public class ColorScheme : IReadOnlyCollection<Color>, IEnumerable<Color>, IEnumerable
- Inheritance
-
ColorScheme
- Implements
-
IReadOnlyCollection<Color>IEnumerable<Color>
- Inherited Members
- Extension Methods
Fields
Bricks
public static readonly ColorScheme Bricks
Field Value
CardboardBoxes
public static readonly ColorScheme CardboardBoxes
Field Value
Ceramics
public static readonly ColorScheme Ceramics
Field Value
ColoredConcrete
public static readonly ColorScheme ColoredConcrete
Field Value
ColoredMetal
public static readonly ColorScheme ColoredMetal
Field Value
Dirt
public static readonly ColorScheme Dirt
Field Value
DirtPaths
public static readonly ColorScheme DirtPaths
Field Value
DyedWood
public static readonly ColorScheme DyedWood
Field Value
Eyes
public static readonly ColorScheme Eyes
Field Value
Flannel
public static readonly ColorScheme Flannel
Field Value
Grays
public static readonly ColorScheme Grays
Field Value
GraysCeramics
public static readonly ColorScheme GraysCeramics
Field Value
Hair
public static readonly ColorScheme Hair
Field Value
Jewelery
public static readonly ColorScheme Jewelery
Field Value
Khakis
public static readonly ColorScheme Khakis
Field Value
Modern
public static readonly ColorScheme Modern
Field Value
ModernPastel
public static readonly ColorScheme ModernPastel
Field Value
MutedPastels
public static readonly ColorScheme MutedPastels
Field Value
Pastel
public static readonly ColorScheme Pastel
Field Value
Plants
public static readonly ColorScheme Plants
Field Value
RedsPinks
public static readonly ColorScheme RedsPinks
Field Value
RetroAppliances
public static readonly ColorScheme RetroAppliances
Field Value
RetroTv
public static readonly ColorScheme RetroTv
Field Value
Rugs
public static readonly ColorScheme Rugs
Field Value
Sand
public static readonly ColorScheme Sand
Field Value
SheetMetal
public static readonly ColorScheme SheetMetal
Field Value
SimpleWood
public static readonly ColorScheme SimpleWood
Field Value
Skin
public static readonly ColorScheme Skin
Field Value
Thatch
public static readonly ColorScheme Thatch
Field Value
Transparent
public static readonly ColorScheme Transparent
Field Value
TrashCanTypes
public static readonly ColorScheme TrashCanTypes
Field Value
TreeBaubles
public static readonly ColorScheme TreeBaubles
Field Value
TreeTinsel
public static readonly ColorScheme TreeTinsel
Field Value
WarmDark
public static readonly ColorScheme WarmDark
Field Value
WarmDarkMutedPastels
public static readonly ColorScheme WarmDarkMutedPastels
Field Value
Water
public static readonly ColorScheme Water
Field Value
White
public static readonly ColorScheme White
Field Value
WhiteGradient
public static readonly ColorScheme WhiteGradient
Field Value
Properties
Count
Returns the amount of Microsoft.Xna.Framework.Color instances that are part of this color scheme
public int Count { get; }
Property Value
this[int]
Returns the Microsoft.Xna.Framework.Color at the given index in this color scheme
public Color this[int index] { get; }
Parameters
index
intThe 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
TextureRegionThe 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
ColorSchemeThe 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.