Color
A straight (non-premultiplied) RGBA color with each channel in the range 0..1.
- Kind: Record struct
- Namespace: SkeleKit
- Implements:
IEquatable<Color>
Constructors
Creates an opaque color (alpha 1).
| Parameter | Summary |
|---|---|
double red | The red channel. |
double green | The green channel. |
double blue | The blue channel. |
Initializes a new instance of the Color struct.
| Parameter | Summary |
|---|---|
double Red | The red channel. |
double Green | The green channel. |
double Blue | The blue channel. |
double Alpha | The alpha channel. |
Properties
Alpha
The alpha channel.
Type: double
Blue
The blue channel.
Type: double
Green
The green channel.
Type: double
Red
The red channel.
Type: double
Methods
Dynamic
A color that resolves per appearance: light normally, dark in dark mode.
Returns
Color: The appearance-aware color.
FromBytes
Creates a color from 8-bit channel values (0..255).
| Parameter | Summary |
|---|---|
byte red | The red channel. |
byte green | The green channel. |
byte blue | The blue channel. |
(optional) byte alpha | The alpha channel. |
Returns
Color: The color represented by the channel values.
FromHex
Creates a color from a packed 0xRRGGBB or 0xAARRGGBB hex value.
| Parameter | Summary |
|---|---|
uint hex | The packed color value. |
Returns
Color: The color represented by the packed value.
WithAlpha
Returns this color with a different alpha (0..1).
| Parameter | Summary |
|---|---|
double alpha | The replacement alpha channel. |
Returns
Color: A copy with the replacement alpha.