Table of Contents

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

R float
G float
B float
A float

Properties

A

public float A { get; init; }

Property Value

float

AByte

public byte AByte { get; }

Property Value

byte

B

public float B { get; init; }

Property Value

float

BByte

public byte BByte { get; }

Property Value

byte

Black

public static RgbaColor Black { get; }

Property Value

RgbaColor

Concrete

public static RgbaColor Concrete { get; }

Property Value

RgbaColor

G

public float G { get; init; }

Property Value

float

GByte

public byte GByte { get; }

Property Value

byte

Glass

public static RgbaColor Glass { get; }

Property Value

RgbaColor

Gray

public static RgbaColor Gray { get; }

Property Value

RgbaColor

Insulation

public static RgbaColor Insulation { get; }

Property Value

RgbaColor

R

public float R { get; init; }

Property Value

float

RByte

public byte RByte { get; }

Property Value

byte

Rebar

public static RgbaColor Rebar { get; }

Property Value

RgbaColor

Steel

public static RgbaColor Steel { get; }

Property Value

RgbaColor

White

public static RgbaColor White { get; }

Property Value

RgbaColor

Methods

ToHex(bool)

Returns CSS hex string format, e.g. "#FF8000" or "#FF8000FF".

public string ToHex(bool includeAlpha = false)

Parameters

includeAlpha bool

Returns

string

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)

Parameters

input string?
color RgbaColor

Returns

bool