Skip to Content
API ReferenceFrameColor

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.

ParameterDescription
rRed channel in the range [0, 1].
gGreen channel in the range [0, 1].
bBlue channel in the range [0, 1].
aAlpha 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.

ParameterDescription
hexThe 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].

ParameterDescription
rRed channel in the range [0, 255].
gGreen channel in the range [0, 255].
bBlue channel in the range [0, 255].
aAlpha 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 .

ParameterDescription
aThe new alpha value in the range [0, 1].

Returns: A new FrameColor with the updated alpha channel.

Last updated on