Struct RgbaColor
- Namespace
- NwcIO.Model
- Assembly
- NwcIO.dll
An RGBA color with normalized floating-point components [0.0 .. 1.0].
public readonly record struct RgbaColor : IEquatable<RgbaColor>Implements
Inherited Members
Constructors
RgbaColor(float, float, float, float)
An RGBA color with normalized floating-point components [0.0 .. 1.0].
public RgbaColor(float R, float G, float B, float A = 1)Parameters
Properties
A
public float A { get; init; }Property Value
AByte
public byte AByte { get; }Property Value
B
public float B { get; init; }Property Value
BByte
public byte BByte { get; }Property Value
Black
public static RgbaColor Black { get; }Property Value
Concrete
public static RgbaColor Concrete { get; }Property Value
G
public float G { get; init; }Property Value
GByte
public byte GByte { get; }Property Value
Glass
public static RgbaColor Glass { get; }Property Value
Gray
public static RgbaColor Gray { get; }Property Value
Insulation
public static RgbaColor Insulation { get; }Property Value
R
public float R { get; init; }Property Value
RByte
public byte RByte { get; }Property Value
Rebar
public static RgbaColor Rebar { get; }Property Value
Steel
public static RgbaColor Steel { get; }Property Value
White
public static RgbaColor White { get; }Property Value
Methods
ToHex(bool)
Returns CSS hex string format, e.g. "#FF8000" or "#FF8000FF".
public string ToHex(bool includeAlpha = false)Parameters
includeAlphabool
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()Returns
- string
-
The fully qualified type name.
TryParse(string?, out RgbaColor)
Parses an RGBA color from Revit comma-separated "255, 128, 0" strings, hex strings "#RRGGBB" / "#RRGGBBAA", or normalized float triples.
public static bool TryParse(string? input, out RgbaColor color)