Gorgon
Show / Hide Table of Contents

Class GorgonSpriteColors

Defines the colors for each corner of a sprite rectangle.

Inheritance
object
GorgonSpriteColors
Implements
IReadOnlyList<GorgonColor>
IReadOnlyCollection<GorgonColor>
IEnumerable<GorgonColor>
IEnumerable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Renderers
Assembly: Gorgon.Renderers.Gorgon2D.dll
Syntax
public class GorgonSpriteColors : IReadOnlyList<GorgonColor>, IReadOnlyCollection<GorgonColor>, IEnumerable<GorgonColor>, IEnumerable

Properties

| Edit this page View Source

Count

Gets the number of elements in the collection.

Declaration
public int Count { get; }
Property Value
Type Description
int
| Edit this page View Source

this[int]

Property to set or return the corner color by index.

Declaration
public GorgonColor this[int index] { get; set; }
Parameters
Type Name Description
int index
Property Value
Type Description
GorgonColor
Remarks

The ordering of the indices is as follows: 0 - Upper left, 1 - Upper right, 2 - Lower right, 3 - Lower left.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when the index is not between 0 and 3.

| Edit this page View Source

LowerLeft

Property to set or return the color of the lower left corner.

Declaration
public GorgonColor LowerLeft { get; set; }
Property Value
Type Description
GorgonColor
| Edit this page View Source

LowerRight

Property to set or return the color of the lower right corner.

Declaration
public GorgonColor LowerRight { get; set; }
Property Value
Type Description
GorgonColor
| Edit this page View Source

UpperLeft

Property to set or return the color of the upper left corner.

Declaration
public GorgonColor UpperLeft { get; set; }
Property Value
Type Description
GorgonColor
| Edit this page View Source

UpperRight

Property to set or return the color of the upper right corner.

Declaration
public GorgonColor UpperRight { get; set; }
Property Value
Type Description
GorgonColor

Methods

| Edit this page View Source

CopyTo(GorgonSpriteColors)

Function to copy the colors into the specified destination.

Declaration
public void CopyTo(GorgonSpriteColors destination)
Parameters
Type Name Description
GorgonSpriteColors destination

The destination that will receive the copy of the colors.

Exceptions
Type Condition
ArgumentNullException

Thrown when the destination parameter is null.

| Edit this page View Source

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration
public IEnumerator<GorgonColor> GetEnumerator()
Returns
Type Description
IEnumerator<GorgonColor>

An enumerator that can be used to iterate through the collection.

| Edit this page View Source

SetAll(in GorgonColor)

Function to assign a single color to all corners.

Declaration
public void SetAll(in GorgonColor color)
Parameters
Type Name Description
GorgonColor color

The color to assign.

Implements

IReadOnlyList<T>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonTreeLinqExtensions.TraverseDepthFirst<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
GorgonTreeLinqExtensions.Traverse<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
GorgonIReadOnlyListExtensions.Contains<T>(IReadOnlyList<T>, T)
GorgonIReadOnlyListExtensions.CopyTo<T>(IReadOnlyList<T>, T[])
GorgonIReadOnlyListExtensions.FirstIndexOf<T>(IReadOnlyList<T>, Predicate<T>)
GorgonIReadOnlyListExtensions.IndexOf<T>(IReadOnlyList<T>, T)
GorgonIReadOnlyListExtensions.LastIndexOf<T>(IReadOnlyList<T>, Predicate<T>)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author