Struct Color
Represents a color using red, green, blue, and alpha components, all normalized to the range [0, 1].
public struct Color
- Inherited Members
Constructors
Color(NFloat, NFloat, NFloat, NFloat)
Initializes a new Color with the specified red, green, blue, and alpha components.
public Color(NFloat red, NFloat green, NFloat blue, NFloat alpha)
Parameters
red
NFloatRed component, normalized [0, 1]
green
NFloatGreen component, normalized [0, 1]
blue
NFloatBlue component, normalized [0, 1]
alpha
NFloatAlpha component, normalized [0, 1]
Color(uint)
Initializes a new Color from a packed 32-bit RGBA value. The value format is 0xRRGGBBAA, where each component is 8 bits.
public Color(uint rgba)
Parameters
rgba
uintPacked RGBA value in 0xRRGGBBAA format.
Fields
Alpha
Alpha (opacity) component of the color, in the range [0, 1].
public NFloat Alpha
Field Value
Blue
Blue component of the color, in the range [0, 1].
public NFloat Blue
Field Value
Green
Green component of the color, in the range [0, 1].
public NFloat Green
Field Value
Red
Red component of the color, in the range [0, 1].
public NFloat Red
Field Value
Properties
IsTransparent
Returns true if the color is fully transparent (Alpha = 0).
public readonly bool IsTransparent { get; }
Property Value
Operators
implicit operator Color(uint)
Implicitly converts a 32-bit RGBA value (0xRRGGBBAA) to a Color.
public static implicit operator Color(uint rgbaHex)
Parameters
rgbaHex
uintPacked RGBA hex value.