Class ColorRange
Color range values.
Implements
Namespace: DIV2.Format.Exporter
Assembly: DIV2.Format.Exporter.dll
Syntax
public sealed class ColorRange : object, ISerializableAsset, IEnumerable<byte>
Constructors
ColorRange(ref Byte)
Creates a new ColorRange instance with default values.
Declaration
public ColorRange(ref byte startColorIndex)
Parameters
Type | Name | Description |
---|---|---|
Byte | startColorIndex | The start color index to setup the range. |
Remarks
By default, when initialize the 16 ranges in a PAL, the idea is create a ramp values from 0 to 255 values and repeat until completes all 16 ranges. This process is automatically setup in ColorRangeTable default constructor.
ColorRange(Byte[])
Creates a new color range from memory.
Declaration
public ColorRange(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | buffer | A |
Fields
blackColor
Declaration
public byte blackColor
Field Value
Type | Description |
---|---|
Byte | Index of the black color. Default is zero. |
colors
Declaration
public ColorRange.RangeColors colors
Field Value
Type | Description |
---|---|
ColorRange.RangeColors | Amount of colors for the range. |
DEFAULT_BLACK_COLOR
Declaration
public const int DEFAULT_BLACK_COLOR = null
Field Value
Type | Description |
---|---|
Int32 | Default value for blackColor field. |
DEFAULT_FIXED_STATE
Declaration
public const bool DEFAULT_FIXED_STATE = null
Field Value
Type | Description |
---|---|
Boolean | Default value for isFixed field. |
DEFAULT_RANGE_COLORS
Declaration
public const ColorRange.RangeColors DEFAULT_RANGE_COLORS = default(ColorRange.RangeColors)
Field Value
Type | Description |
---|---|
ColorRange.RangeColors | Default value for colors field. |
DEFAULT_TYPE
Declaration
public const ColorRange.RangeTypes DEFAULT_TYPE = default(ColorRange.RangeTypes)
Field Value
Type | Description |
---|---|
ColorRange.RangeTypes | Default value for type field. |
isFixed
Declaration
public bool isFixed
Field Value
Type | Description |
---|---|
Boolean | Defines if the range is editable (false) or not (true). By default is false. |
LENGTH
Declaration
public const int LENGTH = null
Field Value
Type | Description |
---|---|
Int32 | Number of color index entries in the range. |
SIZE
Declaration
public const int SIZE = null
Field Value
Type | Description |
---|---|
Int32 | Memory size of the range. |
type
Declaration
public ColorRange.RangeTypes type
Field Value
Type | Description |
---|---|
ColorRange.RangeTypes | Range type. |
Properties
Item[Int32]
Gets or sets the range entry value.
Declaration
public byte this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of the entry. |
Property Value
Type | Description |
---|---|
Byte | Returns the range entry value. |
Methods
GetHashCode()
Generates a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | Returns an |
ToString()
Serializes the relevant data of this instance in a
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | Returns a |
Operators
Equality(ColorRange, ColorRange)
Equality operator.
Declaration
public static bool operator ==(ColorRange a, ColorRange b)
Parameters
Type | Name | Description |
---|---|---|
ColorRange | a | Left ColorRange value to compare. |
ColorRange | b | Right ColorRange value to compare. |
Returns
Type | Description |
---|---|
Boolean | Returns true if both values are equal. |
Inequality(ColorRange, ColorRange)
Inequality operator.
Declaration
public static bool operator !=(ColorRange a, ColorRange b)
Parameters
Type | Name | Description |
---|---|---|
ColorRange | a | Left ColorRange value to compare. |
ColorRange | b | Right ColorRange value to compare. |
Returns
Type | Description |
---|---|
Boolean | Returns true if both values are not equal. |