FrameColor
live An immutable RGBA color with each channel normalized to the range [0, 1].
Constructor
FrameColor
Creates a color from normalized RGBA channel values.
| Parameter | Description |
|---|---|
r | Red channel in the range [0, 1]. |
g | Green channel in the range [0, 1]. |
b | Blue channel in the range [0, 1]. |
a | Alpha channel in the range [0, 1]. Defaults to 1 (fully opaque). |
Properties
A
Alpha channel in the range [0, 1]. 0 is fully transparent, 1 is fully opaque.
B
Blue channel in the range [0, 1].
Black
Opaque black.
Blue
Opaque blue.
G
Green channel in the range [0, 1].
Green
Opaque green.
R
Red channel in the range [0, 1].
Red
Opaque red.
Transparent
Fully transparent black.
White
Opaque white.
Methods
Equals
Equals
FromHex
Creates a color from a hex string in the format #RRGGBB or #RRGGBBAA. The leading # is optional.
| Parameter | Description |
|---|---|
hex | The hex color string. |
Returns: A new FrameColor parsed from the hex string.
FromRgba255
Creates a color from 8-bit per channel RGBA values in the range [0, 255].
| Parameter | Description |
|---|---|
r | Red channel in the range [0, 255]. |
g | Green channel in the range [0, 255]. |
b | Blue channel in the range [0, 255]. |
a | Alpha channel in the range [0, 255]. Defaults to 255 (fully opaque). |
Returns: A new FrameColor with normalized channel values.
GetHashCode
ToString
WithAlpha
Returns a copy of this color with the alpha channel replaced by .
| Parameter | Description |
|---|---|
a | The new alpha value in the range [0, 1]. |
Returns: A new FrameColor with the updated alpha channel.