VegaRise.NET
Back to DOM

ColorClass

Definition

Namespace
DOM.Elements.Graphics.Colors
Assembly
DOM.dll

Represents a color used across the document model.

Remarks

is the universal color type used by text, borders, fills, effects, and every other part of the DOM that needs a color. It supports several color models (RGB / hex, Theme, Scheme, Preset, System), transformations (tint, shade, hue, saturation, luminance, gamma, complement, inverse), and a large library of predefined colors exposed as static readonly fields (,,,, etc.). Color Red Black Accent1 WindowText A color can be constructed from a hex string (with or without leading, and with 3, 6, or 8 digits), from an RGB or ARGB numeric tuple, or from one of the predefined static instances. The color model is automatically detected when parsing from a string. # For theme colors, use the static factory which allows supplying an optional hex override and an optional tint. ThemeColor(ThemeColorValues, string, Percentage)

Examples

csharp
1// 1. Create from a hex string
2var accent = new Color("#FF5733");
3var shortHex = new Color("#F53");
4
csharp
1// 2. Create from RGB or ARGB
2var red = new Color(255, 0, 0);
3var semiBlue = new Color(128, 0, 0, 255); // 50% transparent blue
4
csharp
1// 3. Use a predefined static color
2var black = Color.Black;
3var accent1 = Color.Accent1;
4
csharp
1// 4. Theme color with a tint
2var tinted = Color.ThemeColor(ThemeColorValues.Accent1, ThemeTint: new Percentage(20));
3
csharp
1// 5. Apply a tint or shade to a base color
2var styled = new Color("#3498db");
3styled.Tint = new Percentage(30); // 30% lighter
4styled.Shade = new Percentage(10); // 10% darker
5
csharp
1// 6. Use inside a TextStyle
2var style = new TextStyle
3{
4 Font = new Font { Color = Color.Red },
5 BackgroundColor = Color.LightYellow
6};
7

Constructors

Color()

Initializes an empty instance. All channels are unset; assign them explicitly or use one of the other constructors. Color

Color(string color)

Initializes a new from a string representation. Color

Color(int alpha, int red, int green, int blue)

Initializes a new from ARGB components. Color

Color(int red, int green, int blue)

Initializes a new opaque from RGB components (alpha is set to 255). Color

Properties

Gets or sets the alpha (transparency) channel of the color.

Gets or sets the blue channel of the color.

Gets or sets the color model used by this instance.

ColorValue

Gets a string representation of the color value.

Complement

Gets or sets whether the complement (opposite on the color wheel) should be used.

Gets or sets the green channel of the color.

Gamma

Gets or sets whether gamma correction should be applied.

Hue

Gets or sets the hue rotation applied to the color.

Inverse

Gets or sets whether the color should be inverted.

InverseGamma

Gets or sets whether inverse gamma correction should be applied.

Luminance

Gets or sets the luminance modifier applied to the color.

Gets or sets the red channel of the color.

Saturation

Gets or sets the saturation modifier applied to the color.

Gets or sets the shade (darkening) percentage applied to the color.

ThemeColorValue

Gets or sets the theme color value.

Assigning a value sets to . ColorType ThemeColor

Gets or sets the tint (lightening) percentage applied to the color.

Methods

Parses a string representation of the color and updates this instance accordingly.

Creates a theme color with an optional hex override and tint.

Returns the string representation of the color (hex value or predefined name).

Fields

Accent1

Represents the accent1 color.

Accent2

Represents the accent2 color.

Accent3

Represents the accent3 color.

Accent4

Represents the accent4 color.

Accent5

Represents the accent5 color.

Accent6

Represents the accent6 color.

ActiveBorder

Represents the Active Border color.

ActiveCaption

Represents the Active Caption color.

AdditionalBackgroundColor

Represents the background2 color.

AdditionalTextColor

Represents the TextColor color.

AliceBlue

Gets a system-defined color that has an ARGB value of #F0F8FF.

AntiqueWhite

Gets a system-defined color that has an ARGB value of #FAEBD7.

ApplicationWorkspace

Represents the Application Workspace color.

Aqua

Gets a system-defined color that has an ARGB value of #00FFFF.

Aquamarine

Gets a system-defined color that has an ARGB value of #7FFFD4.

AutoColor

Represents the hyperlink color.

Automatic

The value.

Azure

Gets a system-defined color that has an ARGB value of #F0FFFF.

Background

Represents the Background color.

Background1

Represents the background1 color.

Background2

Represents the background2 color.

BackgroundColor

Represents the background2 color.

Beige

Gets a system-defined color that has an ARGB value of #F5F5DC.

Bisque

Gets a system-defined color that has an ARGB value of #FFE4C4.

Black

Gets a system-defined color that has an ARGB value of #000000.

BlanchedAlmond

Gets a system-defined color that has an ARGB value of #FFEBCD.

Blue

Gets a system-defined color that has an ARGB value of #0000FF.

BlueViolet

Gets a system-defined color that has an ARGB value of #8A2BE2.

Brown

Gets a system-defined color that has an ARGB value of #A52A2A.

BurlyWood

Gets a system-defined color that has an ARGB value of #DEB887.

ButtonFace

Represents the Button Face color.

ButtonHighlight

Represents the Button Highlight color.

ButtonShadow

Represents the Button Shadow color.

ButtonText

Represents the Button Text color.

CadetBlue

Gets a system-defined color that has an ARGB value of #5F9EA0.

CaptionText

Represents the Caption Text color.

Chartreuse

Gets a system-defined color that has an ARGB value of #7FFF00.

Chocolate

Gets a system-defined color that has an ARGB value of #D2691E.

Coral

Gets a system-defined color that has an ARGB value of #FF7F50.

CornflowerBlue

Gets a system-defined color that has an ARGB value of #6495ED.

Cornsilk

Gets a system-defined color that has an ARGB value of #FFF8DC.

Crimson

Gets a system-defined color that has an ARGB value of #DC143C.

Cyan

Gets a system-defined color that has an ARGB value of #00FFFF.

Dark1

Represents the dark1 color.

Dark2

Represents the dark2 color.

DarkBlue

Gets a system-defined color that has an ARGB value of #00008B.

DarkCyan

Gets a system-defined color that has an ARGB value of #008B8B.

DarkGoldenrod

Gets a system-defined color that has an ARGB value of #B8860B.

DarkGray

Gets a system-defined color that has an ARGB value of #A9A9A9.

DarkGreen

Gets a system-defined color that has an ARGB value of #006400.

DarkKhaki

Gets a system-defined color that has an ARGB value of #BDB76B.

DarkMagenta

Gets a system-defined color that has an ARGB value of #8B008B.

DarkOliveGreen

Gets a system-defined color that has an ARGB value of #556B2F.

DarkOrange

Gets a system-defined color that has an ARGB value of #FF8C00.

DarkOrchid

Gets a system-defined color that has an ARGB value of #9932CC.

DarkRed

Gets a system-defined color that has an ARGB value of #8B0000.

DarkSalmon

Gets a system-defined color that has an ARGB value of #E9967A.

DarkSeaGreen

Gets a system-defined color that has an ARGB value of #8FBC8B.

DarkSlateBlue

Gets a system-defined color that has an ARGB value of #483D8B.

DarkSlateGray

Gets a system-defined color that has an ARGB value of #2F4F4F.

DarkTurquoise

Gets a system-defined color that has an ARGB value of #00CED1.

DarkViolet

Gets a system-defined color that has an ARGB value of #9400D3.

DeepPink

Gets a system-defined color that has an ARGB value of #FF1493.

DeepSkyBlue

Gets a system-defined color that has an ARGB value of #00BFFF.

DimGray

Gets a system-defined color that has an ARGB value of #696969.

DodgerBlue

Gets a system-defined color that has an ARGB value of #1E90FF.

Empty

The value.

ExtraSchemeColor1

Represents the hyperlink color.

ExtraSchemeColor2

Represents the hyperlink color.

ExtraSchemeColor3

Represents the hyperlink color.

ExtraSchemeColor4

Represents the hyperlink color.

ExtraSchemeColor5

Represents the hyperlink color.

ExtraSchemeColor6

Represents the hyperlink color.

Firebrick

Gets a system-defined color that has an ARGB value of #B22222.

FloralWhite

Gets a system-defined color that has an ARGB value of #FFFAF0.

FollowedHyperlink

Represents the followed hyperlink color.

ForestGreen

Gets a system-defined color that has an ARGB value of #228B22.

Fuchsia

Gets a system-defined color that has an ARGB value of #FF00FF.

Gainsboro

Gets a system-defined color that has an ARGB value of #DCDCDC.

GhostWhite

Gets a system-defined color that has an ARGB value of #F8F8FF.

Gold

Gets a system-defined color that has an ARGB value of #FFD700.

Goldenrod

Gets a system-defined color that has an ARGB value of #DAA520.

GradientActiveCaption

Represents the Gradient Active Caption color.

GradientInactiveCaption

Represents the Gradient Inactive Caption color.

Gray

Gets a system-defined color that has an ARGB value of #808080.

GrayText

Represents the Gray Text color.

Green

Gets a system-defined color that has an ARGB value of #008000.

GreenYellow

Gets a system-defined color that has an ARGB value of #ADFF2F.

Highlight

Represents the Highlight color.

HighlightText

Represents the Highlight Text color.

Honeydew

Gets a system-defined color that has an ARGB value of #F0FFF0.

HotLight

Represents the Hot Light color.

HotPink

Gets a system-defined color that has an ARGB value of #FF69B4.

Hyperlink

Represents the hyperlink color.

HyperlinkColor

Represents the hyperlink color.

InactiveBorder

Represents the Inactive Border color.

InactiveCaption

Represents the Inactive Caption color.

InactiveCaptionText

Represents the Inactive Caption Text color.

IndianRed

Gets a system-defined color that has an ARGB value of #CD5C5C.

Indigo

Gets a system-defined color that has an ARGB value of #4B0082.

InfoBack

Represents the Info Back color.

InfoText

Represents the Info Text color.

Ivory

Gets a system-defined color that has an ARGB value of #FFFFF0.

Khaki

Gets a system-defined color that has an ARGB value of #F0E68C.

Lavender

Gets a system-defined color that has an ARGB value of #E6E6FA.

LavenderBlush

Gets a system-defined color that has an ARGB value of #FFF0F5.

LawnGreen

Gets a system-defined color that has an ARGB value of #7CFC00.

LemonChiffon

Gets a system-defined color that has an ARGB value of #FFFACD.

Light1

Represents the light1 color.

Light2

Represents the light2 color.

LightBlue

Gets a system-defined color that has an ARGB value of #ADD8E6.

LightCoral

Gets a system-defined color that has an ARGB value of #F08080.

LightCyan

Gets a system-defined color that has an ARGB value of #E0FFFF.

LightGoldenrodYellow

Gets a system-defined color that has an ARGB value of #FAFAD2.

LightGray

Gets a system-defined color that has an ARGB value of #D3D3D3.

LightGreen

Gets a system-defined color that has an ARGB value of #90EE90.

LightPink

Gets a system-defined color that has an ARGB value of #FFB6C1.

LightSalmon

Gets a system-defined color that has an ARGB value of #FFA07A.

LightSeaGreen

Gets a system-defined color that has an ARGB value of #20B2AA.

LightSkyBlue

Gets a system-defined color that has an ARGB value of #87CEFA.

LightSlateGray

Gets a system-defined color that has an ARGB value of #778899.

LightSteelBlue

Gets a system-defined color that has an ARGB value of #B0C4DE.

LightYellow

Gets a system-defined color that has an ARGB value of #FFFFE0.

Lime

Gets a system-defined color that has an ARGB value of #00FF00.

LimeGreen

Gets a system-defined color that has an ARGB value of #32CD32.

Linen

Gets a system-defined color that has an ARGB value of #FAF0E6.

Magenta

Gets a system-defined color that has an ARGB value of #FF00FF.

MainDarkColor1

Represents the hyperlink color.

MainDarkColor2

Represents the hyperlink color.

MainLightColor1

Represents the hyperlink color.

MainLightColor2

Represents the hyperlink color.

Maroon

Gets a system-defined color that has an ARGB value of #800000.

MediumAquamarine

Gets a system-defined color that has an ARGB value of #66CDAA.

MediumBlue

Gets a system-defined color that has an ARGB value of #0000CD.

MediumOrchid

Gets a system-defined color that has an ARGB value of #BA55D3.

MediumPurple

Gets a system-defined color that has an ARGB value of #9370DB.

MediumSeaGreen

Gets a system-defined color that has an ARGB value of #3CB371.

MediumSlateBlue

Gets a system-defined color that has an ARGB value of #7B68EE.

MediumSpringGreen

Gets a system-defined color that has an ARGB value of #00FA9A.

MediumTurquoise

Gets a system-defined color that has an ARGB value of #48D1CC.

MediumVioletRed

Gets a system-defined color that has an ARGB value of #C71585.

Menu

Represents the Menu color.

MenuBar

Represents the Menu Bar color.

MenuHighlight

Represents the Menu Highlight color.

MenuText

Represents the Menu Text color.

MidnightBlue

Gets a system-defined color that has an ARGB value of #191970.

MintCream

Gets a system-defined color that has an ARGB value of #F5FFFA.

MistyRose

Gets a system-defined color that has an ARGB value of #FFE4E1.

Moccasin

Gets a system-defined color that has an ARGB value of #FFE4B5.

NavajoWhite

Gets a system-defined color that has an ARGB value of #FFDEAD.

Navy

Gets a system-defined color that has an ARGB value of #000080.

None

Represents none as the color.

OldLace

Gets a system-defined color that has an ARGB value of #FDF5E6.

Olive

Gets a system-defined color that has an ARGB value of #808000.

OliveDrab

Gets a system-defined color that has an ARGB value of #6B8E23.

Orange

Gets a system-defined color that has an ARGB value of #FFA500.

OrangeRed

Gets a system-defined color that has an ARGB value of #FF4500.

Orchid

Gets a system-defined color that has an ARGB value of #DA70D6.

PaleGoldenrod

Gets a system-defined color that has an ARGB value of #EEE8AA.

PaleGreen

Gets a system-defined color that has an ARGB value of #98FB98.

PaleTurquoise

Gets a system-defined color that has an ARGB value of #AFEEEE.

PaleVioletRed

Gets a system-defined color that has an ARGB value of #DB7093.

PapayaWhip

Gets a system-defined color that has an ARGB value of #FFEFD5.

PeachPuff

Gets a system-defined color that has an ARGB value of #FFDAB9.

Peru

Gets a system-defined color that has an ARGB value of #CD853F.

Pink

Gets a system-defined color that has an ARGB value of #FFC0CB.

Plum

Gets a system-defined color that has an ARGB value of #DDA0DD.

PowderBlue

Gets a system-defined color that has an ARGB value of #B0E0E6.

Purple

Gets a system-defined color that has an ARGB value of #800080.

RebeccaPurple

Gets a system-defined color that has an ARGB value of #663399.

Red

Gets a system-defined color that has an ARGB value of #FF0000.

RosyBrown

Gets a system-defined color that has an ARGB value of #BC8F8F.

RoyalBlue

Gets a system-defined color that has an ARGB value of #4169E1.

SaddleBrown

Gets a system-defined color that has an ARGB value of #8B4513.

Salmon

Gets a system-defined color that has an ARGB value of #FA8072.

SandyBrown

Gets a system-defined color that has an ARGB value of #F4A460.

ScrollBar

Represents the Scroll Bar color.

SeaGreen

Gets a system-defined color that has an ARGB value of #2E8B57.

SeaShell

Gets a system-defined color that has an ARGB value of #FFF5EE.

Sienna

Gets a system-defined color that has an ARGB value of #A0522D.

Silver

Gets a system-defined color that has an ARGB value of #C0C0C0.

SkyBlue

Gets a system-defined color that has an ARGB value of #87CEEB.

SlateBlue

Gets a system-defined color that has an ARGB value of #6A5ACD.

SlateGray

Gets a system-defined color that has an ARGB value of #708090.

Snow

Gets a system-defined color that has an ARGB value of #FFFAFA.

SpringGreen

Gets a system-defined color that has an ARGB value of #00FF7F.

SteelBlue

Gets a system-defined color that has an ARGB value of #4682B4.

Tan

Gets a system-defined color that has an ARGB value of #D2B48C.

Teal

Gets a system-defined color that has an ARGB value of #008080.

Text1

Represents the text1 color.

Text2

Represents the text2 color.

TextColor

Represents the TextColor color.

Thistle

Gets a system-defined color that has an ARGB value of #D2B48C.

ThreeDDarkShadow

Represents the 3D Dark color.

ThreeDLight

Represents the 3D Light color.

Tomato

Gets a system-defined color that has an ARGB value of #FF6347.

Transparent

Gets a system-defined color that has an ARGB value of #00FFFFFF.

Turquoise

Gets a system-defined color that has an ARGB value of #40E0D0.

Violet

Gets a system-defined color that has an ARGB value of #EE82EE.

Wheat

Gets a system-defined color that has an ARGB value of #F5DEB3.

White

Gets a system-defined color that has an ARGB value of #FFFFFF.

WhiteSmoke

Gets a system-defined color that has an ARGB value of #F5F5F5.

Window

Represents the Window color.

WindowFrame

Represents the Window Frame color.

WindowText

Represents the Window Text color.

Yellow

Gets a system-defined color that has an ARGB value of #FFFF00.

YellowGreen

Gets a system-defined color that has an ARGB value of #9ACD32.

VegaRiseVDocs.NET

Reset Password

Enter your email and we'll send you a link to reset your password.

Remember your password? Sign in