Search Results for

    Show / Hide Table of Contents

    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()
    Namespace: TinyLife.Utilities
    Assembly: Tiny Life.dll
    Syntax
    public class ColorScheme : IReadOnlyCollection<Color>, IEnumerable<Color>, IEnumerable

    Fields

    Bricks

    Declaration
    public static readonly ColorScheme Bricks
    Field Value
    Type Description
    ColorScheme

    CardboardBoxes

    Declaration
    public static readonly ColorScheme CardboardBoxes
    Field Value
    Type Description
    ColorScheme

    Ceramics

    Declaration
    public static readonly ColorScheme Ceramics
    Field Value
    Type Description
    ColorScheme

    Dirt

    Declaration
    public static readonly ColorScheme Dirt
    Field Value
    Type Description
    ColorScheme

    DirtPaths

    Declaration
    public static readonly ColorScheme DirtPaths
    Field Value
    Type Description
    ColorScheme

    DyedWood

    Declaration
    public static readonly ColorScheme DyedWood
    Field Value
    Type Description
    ColorScheme

    Eyes

    Declaration
    public static readonly ColorScheme Eyes
    Field Value
    Type Description
    ColorScheme

    Flannel

    Declaration
    public static readonly ColorScheme Flannel
    Field Value
    Type Description
    ColorScheme

    Grays

    Declaration
    public static readonly ColorScheme Grays
    Field Value
    Type Description
    ColorScheme

    Hair

    Declaration
    public static readonly ColorScheme Hair
    Field Value
    Type Description
    ColorScheme

    Jewelery

    Declaration
    public static readonly ColorScheme Jewelery
    Field Value
    Type Description
    ColorScheme

    Khakis

    Declaration
    public static readonly ColorScheme Khakis
    Field Value
    Type Description
    ColorScheme

    Modern

    Declaration
    public static readonly ColorScheme Modern
    Field Value
    Type Description
    ColorScheme

    ModernShort

    Declaration
    public static readonly ColorScheme ModernShort
    Field Value
    Type Description
    ColorScheme

    MutedPastels

    Declaration
    public static readonly ColorScheme MutedPastels
    Field Value
    Type Description
    ColorScheme

    Pastel

    Declaration
    public static readonly ColorScheme Pastel
    Field Value
    Type Description
    ColorScheme

    Plants

    Declaration
    public static readonly ColorScheme Plants
    Field Value
    Type Description
    ColorScheme

    RetroAppliances

    Declaration
    public static readonly ColorScheme RetroAppliances
    Field Value
    Type Description
    ColorScheme

    RetroTv

    Declaration
    public static readonly ColorScheme RetroTv
    Field Value
    Type Description
    ColorScheme

    Rugs

    Declaration
    public static readonly ColorScheme Rugs
    Field Value
    Type Description
    ColorScheme

    SimpleWood

    Declaration
    public static readonly ColorScheme SimpleWood
    Field Value
    Type Description
    ColorScheme

    Skin

    Declaration
    public static readonly ColorScheme Skin
    Field Value
    Type Description
    ColorScheme

    Thatch

    Declaration
    public static readonly ColorScheme Thatch
    Field Value
    Type Description
    ColorScheme

    Transparent

    Declaration
    public static readonly ColorScheme Transparent
    Field Value
    Type Description
    ColorScheme

    TrashCanTypes

    Declaration
    public static readonly ColorScheme TrashCanTypes
    Field Value
    Type Description
    ColorScheme

    TreeBaubles

    Declaration
    public static readonly ColorScheme TreeBaubles
    Field Value
    Type Description
    ColorScheme

    TreeTinsle

    Declaration
    public static readonly ColorScheme TreeTinsle
    Field Value
    Type Description
    ColorScheme

    WarmDark

    Declaration
    public static readonly ColorScheme WarmDark
    Field Value
    Type Description
    ColorScheme

    Water

    Declaration
    public static readonly ColorScheme Water
    Field Value
    Type Description
    ColorScheme

    White

    Declaration
    public static readonly ColorScheme White
    Field Value
    Type Description
    ColorScheme

    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
    Type Name Description
    ColorScheme left

    The left color scheme

    ColorScheme right

    The right color scheme

    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
    Type Name Description
    ColorScheme left
    ColorScheme right
    Returns
    Type Description
    ColorScheme

    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

    Extensions.JsonCopy<T>(T)
    ☀
    ☾
    In This Article
    Back to top
    © 2021-2023 Ellpeck Games, Top Hat Studios – Impressum – Privacy – Status
    ☀
    ☾