Class CustomKeypadEffect
Custom effect.
Implements
Namespace: Colore.Effects.Keypad
Assembly: Colore.dll
Syntax
public sealed class CustomKeypadEffect : ValueType, IEquatable<CustomKeypadEffect>
Constructors
CustomKeypadEffect(Color)
Initializes a new instance of the CustomKeypadEffect struct with every position set to a specific color.
Declaration
public CustomKeypadEffect(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The Color to set each position to. |
CustomKeypadEffect(Color[][])
Initializes a new instance of the CustomKeypadEffect struct.
Declaration
public CustomKeypadEffect(Color[][] colors)
Parameters
Type | Name | Description |
---|---|---|
Color[][] | colors | The colors to use. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
ArgumentException | Thrown if the colors array supplied is of an incorrect size. |
CustomKeypadEffect(CustomKeypadEffect)
Initializes a new instance of the CustomKeypadEffect struct with color values copied from another struct of the same type.
Declaration
public CustomKeypadEffect(CustomKeypadEffect other)
Parameters
Type | Name | Description |
---|---|---|
CustomKeypadEffect | other | The struct to copy data from. |
CustomKeypadEffect(IList<Color>)
Initializes a new instance of the CustomKeypadEffect struct.
Declaration
public CustomKeypadEffect(IList<Color> colors)
Parameters
Type | Name | Description |
---|---|---|
IList<Color> | colors | The colors to use. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
ArgumentException | Thrown if the colors array supplied is of an invalid size. |
Properties
Item[Int32]
Gets or sets a position in the custom grid.
Declaration
public Color this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index to access, zero indexed. |
Property Value
Type | Description |
---|---|
Color | The Color at the specified position. |
Item[Int32, Int32]
Gets or sets cells in the custom grid.
Declaration
public Color this[int row, int column] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | row | Row to access, zero indexed. |
Int32 | column | Column to access, zero indexed. |
Property Value
Type | Description |
---|---|
Color | The Color at the specified position. |
Methods
Clear()
Clears the colors from the grid, setting them to Black.
Declaration
public void Clear()
Clone()
Returns a copy of this struct.
Declaration
public CustomKeypadEffect Clone()
Returns
Type | Description |
---|---|
CustomKeypadEffect | A copy of this struct. |
Create()
Creates a new empty CustomKeypadEffect struct.
Declaration
public static CustomKeypadEffect Create()
Returns
Type | Description |
---|---|
CustomKeypadEffect | An instance of CustomKeypadEffect filled with the color black. |
Equals(CustomKeypadEffect)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(CustomKeypadEffect other)
Parameters
Type | Name | Description |
---|---|---|
CustomKeypadEffect | other | A CustomKeypadEffect to compare with this object. |
Returns
Type | Description |
---|---|
Boolean |
|
Equals(Object)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | Another object to compare to. |
Returns
Type | Description |
---|---|
Boolean |
|
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A 32-bit signed integer that is the hash code for this instance. |
Set(Color)
Sets all LED indices to the specified Color.
Declaration
public void Set(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The Color to set. |
Operators
Equality(CustomKeypadEffect, Object)
Compares an instance of CustomKeypadEffect with another object for equality.
Declaration
public static bool operator ==(CustomKeypadEffect left, object right)
Parameters
Type | Name | Description |
---|---|---|
CustomKeypadEffect | left | The left operand, an instance of CustomKeypadEffect. |
Object | right | The right operand, any type of object. |
Returns
Type | Description |
---|---|
Boolean |
|
Inequality(CustomKeypadEffect, Object)
Compares an instance of CustomKeypadEffect with another object for inequality.
Declaration
public static bool operator !=(CustomKeypadEffect left, object right)
Parameters
Type | Name | Description |
---|---|---|
CustomKeypadEffect | left | The left operand, an instance of CustomKeypadEffect. |
Object | right | The right operand, any type of object. |
Returns
Type | Description |
---|---|
Boolean |
|