Project

ChartForgeX

Render deterministic charts, dashboards, topology, hierarchy, and report visuals directly from .NET.

Stars 47
Forks 2
NuGet downloads 75,067
Release ChartForgeX-v2.0.0
Language: HTML Updated: 2026-10-12

API Reference

Struct

ChartColor

Namespace ChartForgeX.Primitives
Assembly ChartForgeX
Base ValueType
Modifiers sealed

Represents an RGBA color used by ChartForgeX renderers.

Inheritance

  • ValueType
  • ChartColor

Usage

Explore 653 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 411

Accepted by parameters 242

Constructors

public ChartColor(Byte r, Byte g, Byte b, Byte a = 255) #

Initializes a new instance of the ChartColor struct.

Parameters

r System.Byte requiredposition: 0
The red channel.
g System.Byte requiredposition: 1
The green channel.
b System.Byte requiredposition: 2
The blue channel.
a System.Byte = 255 optionalposition: 3
The alpha channel.

Methods

public Void Deconstruct(out Byte r, out Byte g, out Byte b, out Byte a) #
Returns: Void

Deconstructs the color into red, green, blue, and alpha channels.

Parameters

r System.Byte requiredposition: 0
The red channel.
g System.Byte requiredposition: 1
The green channel.
b System.Byte requiredposition: 2
The blue channel.
a System.Byte requiredposition: 3
The alpha channel.
FromArgb 3 overloads
public static ChartColor FromArgb(Byte a, Byte r, Byte g, Byte b) #
Returns: ChartColor

Creates a color from explicit alpha, red, green, and blue channels.

Parameters

a System.Byte requiredposition: 0
The alpha channel.
r System.Byte requiredposition: 1
The red channel.
g System.Byte requiredposition: 2
The green channel.
b System.Byte requiredposition: 3
The blue channel.

Returns

A chart color.

public static ChartColor FromArgb(UInt32 argb) #
Returns: ChartColor

Creates a color from a packed 0xAARRGGBB value.

Parameters

argb System.UInt32 requiredposition: 0
The packed ARGB color.

Returns

A chart color.

public static ChartColor FromArgb(Int32 argb) #
Returns: ChartColor

Creates a color from a packed 0xAARRGGBB value.

Parameters

argb System.Int32 requiredposition: 0
The packed ARGB color.

Returns

A chart color.

public static ChartColor FromHex(String hex) #
Returns: ChartColor

Creates a color from #RGB, #RGBA, #RRGGBB, or #RRGGBBAA notation.

Parameters

hex System.String requiredposition: 0
The hexadecimal color string.

Returns

A chart color.

public static ChartColor FromRgb(Byte r, Byte g, Byte b) #
Returns: ChartColor

Creates an opaque RGB color.

Parameters

r System.Byte requiredposition: 0
The red channel.
g System.Byte requiredposition: 1
The green channel.
b System.Byte requiredposition: 2
The blue channel.

Returns

An opaque chart color.

FromRgba 2 overloads
public static ChartColor FromRgba(Byte r, Byte g, Byte b, Byte a) #
Returns: ChartColor

Creates a color with an explicit alpha channel.

Parameters

r System.Byte requiredposition: 0
The red channel.
g System.Byte requiredposition: 1
The green channel.
b System.Byte requiredposition: 2
The blue channel.
a System.Byte requiredposition: 3
The alpha channel.

Returns

A chart color.

public static ChartColor FromRgba(UInt32 rgba) #
Returns: ChartColor

Creates a color from a packed 0xRRGGBBAA value.

Parameters

rgba System.UInt32 requiredposition: 0
The packed RGBA color.

Returns

A chart color.

public static ChartColor Parse(String value) #
Returns: ChartColor

Parses a named color or a hexadecimal color string.

Parameters

value System.String requiredposition: 0
The named color or hexadecimal color string.

Returns

A chart color.

public UInt32 ToArgb() #
Returns: UInt32

Converts the color to a packed 0xAARRGGBB value.

Returns

The packed ARGB color.

public Int32 ToArgbInt32() #
Returns: Int32

Converts the color to a packed 0xAARRGGBB signed integer.

Returns

The packed ARGB color as a signed integer.

public String ToCss() #
Returns: String

Converts the color to a CSS color string.

Returns

A hexadecimal or rgba CSS color string.

public String ToHex() #
Returns: String

Converts the color to a hexadecimal RGB string.

Returns

A CSS-compatible hexadecimal color string.

public String ToHexRgba() #
Returns: String

Converts the color to a hexadecimal RGBA string.

Returns

A CSS-compatible hexadecimal color string with alpha.

public UInt32 ToRgba() #
Returns: UInt32

Converts the color to a packed 0xRRGGBBAA value.

Returns

The packed RGBA color.

public static Boolean TryFromHex(String? hex, out ChartColor color) #
Returns: Boolean

Attempts to create a color from #RGB, #RGBA, #RRGGBB, or #RRGGBBAA notation.

Parameters

hex System.String? requiredposition: 0
The hexadecimal color string.
color ChartForgeX.Primitives.ChartColor requiredposition: 1
The parsed chart color.

Returns

True when parsing succeeds.

public static Boolean TryParse(String? value, out ChartColor color) #
Returns: Boolean

Attempts to parse a named color or a hexadecimal color string.

Parameters

value System.String? requiredposition: 0
The named color or hexadecimal color string.
color ChartForgeX.Primitives.ChartColor requiredposition: 1
The parsed chart color.

Returns

True when parsing succeeds.

public ChartColor WithAlpha(Byte alpha) #
Returns: ChartColor

Creates a copy of this color with a different alpha channel.

Parameters

alpha System.Byte requiredposition: 0
The alpha channel.

Returns

A chart color with the requested alpha channel.

public ChartColor WithOpacity(Double opacity) #
Returns: ChartColor

Creates a copy of this color with opacity expressed as a unit interval.

Parameters

opacity System.Double requiredposition: 0
The opacity from zero to one.

Returns

A chart color with the requested opacity.

Properties

public static ChartColor Transparent { get; } #

Gets a fully transparent color.

public static ChartColor White { get; } #

Gets opaque white.

public static ChartColor Black { get; } #

Gets opaque black.

Fields

public readonly Byte R #

Gets the red channel.

public readonly Byte G #

Gets the green channel.

public readonly Byte B #

Gets the blue channel.

public readonly Byte A #

Gets the alpha channel.