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
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
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
ModernShort
public static readonly ColorScheme ModernShort
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
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
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
Water
public static readonly ColorScheme Water
Field Value
White
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
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
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
ColorSchemeThe left color scheme
right
ColorSchemeThe 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
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.
Multiply(ColorScheme, Color)
public static ColorScheme Multiply(ColorScheme scheme, Color color)
Parameters
scheme
ColorSchemecolor
Color
Returns
Multiply(ColorScheme, float)
public static ColorScheme Multiply(ColorScheme scheme, float percentage)
Parameters
scheme
ColorSchemepercentage
float
Returns
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
ColorSchemeThe left color scheme
right
ColorSchemeThe right color scheme
Returns
- ColorScheme
A new, combined color scheme
operator *(ColorScheme, Color)
public static ColorScheme operator *(ColorScheme scheme, Color color)
Parameters
scheme
ColorSchemecolor
Color
Returns
operator *(ColorScheme, float)
public static ColorScheme operator *(ColorScheme scheme, float percentage)
Parameters
scheme
ColorSchemepercentage
float