VectSharp 2.6.1
A light library for C# vector graphics
|
Represents an RGB colour. More...
Public Member Functions | |
override bool | Equals (object obj) |
bool | Equals (Colour col) |
override int | GetHashCode () |
string | ToCSSString (bool includeAlpha) |
Convert the Colour object into a hex string that is constituted by a "#" followed by two-digit hexadecimal representations of the red, green and blue components of the colour (in the range 0x00 - 0xFF). Optionally also includes opacity (alpha channel) data. More... | |
Colour | WithAlpha (double alpha) |
Create a new Colour with the same RGB components as the current Colour, but with the specified alpha . More... | |
Colour | WithAlpha (byte alpha) |
Create a new Colour with the same RGB components as the current Colour, but with the specified alpha . More... | |
double double double Z | ToXYZ () |
double double double b | ToLab () |
double double double L | ToHSL () |
Static Public Member Functions | |
static Colour | FromRgb (double r, double g, double b) |
Create a new colour from RGB (red, green and blue) values. More... | |
static Colour | FromRgb (byte r, byte g, byte b) |
Create a new colour from RGB (red, green and blue) values. More... | |
static Colour | FromRgb (int r, int g, int b) |
Create a new colour from RGB (red, green and blue) values. More... | |
static Colour | FromRgba (double r, double g, double b, double a) |
Create a new colour from RGBA (red, green, blue and alpha) values. More... | |
static Colour | FromRgba (byte r, byte g, byte b, byte a) |
Create a new colour from RGBA (red, green, blue and alpha) values. More... | |
static Colour | FromRgba (byte r, byte g, byte b, double a) |
Create a new colour from RGBA (red, green, blue and alpha) values. More... | |
static Colour | FromRgba (int r, int g, int b, int a) |
Create a new colour from RGBA (red, green, blue and alpha) values. More... | |
static Colour | FromRgba (int r, int g, int b, double a) |
Create a new colour from RGBA (red, green, blue and alpha) values. More... | |
static Colour | FromRgba ((int r, int g, int b, double a) colour) |
Create a new colour from RGBA (red, green, blue and alpha) values. More... | |
static bool | operator== (Colour col1, Colour col2) |
static bool | operator!= (Colour col1, Colour col2) |
static ? Colour | FromCSSString (string cssString) |
Convert a CSS colour string into a Colour object. More... | |
static Colour | WithAlpha (Colour original, double alpha) |
Create a new Colour with the same RGB components as the original Colour, but with the specified alpha . More... | |
static Colour | WithAlpha (Colour original, byte alpha) |
Create a new Colour with the same RGB components as the original Colour, but with the specified alpha . More... | |
static Colour | FromXYZ (double x, double y, double z) |
Creates a Colour from CIE XYZ coordinates. More... | |
static Colour | FromLab (double L, double a, double b) |
Creates a Colour from CIE Lab coordinates (under Illuminant D65). More... | |
static Colour | FromHSL (double h, double s, double l) |
Creates a Colour from HSL coordinates. More... | |
Public Attributes | |
double | R |
Red component of the colour. Range: [0, 1]. More... | |
double | G |
Green component of the colour. Range: [0, 1]. More... | |
double | B |
Blue component of the colour. Range: [0, 1]. More... | |
double | A |
Alpha component of the colour. Range: [0, 1]. More... | |
double | X |
Converts a Colour to the CIE XYZ colour space. More... | |
double double | Y |
double | L |
Converts a Colour to the CIE Lab colour space (under Illuminant D65). More... | |
double double | a |
double | H |
Converts a Colour to the HSL colour space. More... | |
double double | S |
|
static |
Convert a CSS colour string into a Colour object.
cssString | The CSS colour string. In addition to 148 standard colour names (case-insensitive), #RGB, #RGBA, #RRGGBB and #RRGGBBAA hex strings and rgb(r, g, b) and rgba(r, g, b, a) functional colour notations are supported. |
|
static |
|
static |
|
static |
Create a new colour from RGB (red, green and blue) values.
r | The red component of the colour. Range: [0, 255]. |
g | The green component of the colour. Range: [0, 255]. |
b | The blue component of the colour. Range: [0, 255]. |
|
static |
Create a new colour from RGB (red, green and blue) values.
r | The red component of the colour. Range: [0, 1]. |
g | The green component of the colour. Range: [0, 1]. |
b | The blue component of the colour. Range: [0, 1]. |
|
static |
Create a new colour from RGB (red, green and blue) values.
r | The red component of the colour. Range: [0, 255]. |
g | The green component of the colour. Range: [0, 255]. |
b | The blue component of the colour. Range: [0, 255]. |
|
static |
Create a new colour from RGBA (red, green, blue and alpha) values.
colour | A ValueTuple<Int32, Int32, Int32, Double> containing component information for the colour. For r, g, and b, range: [0, 255]; for a, range: [0, 1]. |
|
static |
Create a new colour from RGBA (red, green, blue and alpha) values.
r | The red component of the colour. Range: [0, 255]. |
g | The green component of the colour. Range: [0, 255]. |
b | The blue component of the colour. Range: [0, 255]. |
a | The alpha component of the colour. Range: [0, 255]. |
|
static |
Create a new colour from RGBA (red, green, blue and alpha) values.
r | The red component of the colour. Range: [0, 255]. |
g | The green component of the colour. Range: [0, 255]. |
b | The blue component of the colour. Range: [0, 255]. |
a | The alpha component of the colour. Range: [0, 1]. |
|
static |
Create a new colour from RGBA (red, green, blue and alpha) values.
r | The red component of the colour. Range: [0, 1]. |
g | The green component of the colour. Range: [0, 1]. |
b | The blue component of the colour. Range: [0, 1]. |
a | The alpha component of the colour. Range: [0, 1]. |
|
static |
Create a new colour from RGBA (red, green, blue and alpha) values.
r | The red component of the colour. Range: [0, 255]. |
g | The green component of the colour. Range: [0, 255]. |
b | The blue component of the colour. Range: [0, 255]. |
a | The alpha component of the colour. Range: [0, 1]. |
|
static |
Create a new colour from RGBA (red, green, blue and alpha) values.
r | The red component of the colour. Range: [0, 255]. |
g | The green component of the colour. Range: [0, 255]. |
b | The blue component of the colour. Range: [0, 255]. |
a | The alpha component of the colour. Range: [0, 255]. |
|
static |
string VectSharp.Colour.ToCSSString | ( | bool | includeAlpha | ) |
Convert the Colour object into a hex string that is constituted by a "#" followed by two-digit hexadecimal representations of the red, green and blue components of the colour (in the range 0x00 - 0xFF). Optionally also includes opacity (alpha channel) data.
includeAlpha | Whether two additional hex digits representing the colour's opacity (alpha channel) should be included in the string. |
Colour VectSharp.Colour.WithAlpha | ( | byte | alpha | ) |
Create a new Colour with the same RGB components as the original Colour, but with the specified alpha .
original | The original Colour from which the RGB components will be taken. |
alpha | The alpha component of the new Colour. |
Create a new Colour with the same RGB components as the original Colour, but with the specified alpha .
original | The original Colour from which the RGB components will be taken. |
alpha | The alpha component of the new Colour. |
Colour VectSharp.Colour.WithAlpha | ( | double | alpha | ) |
double VectSharp.Colour.A |
double VectSharp.Colour.B |
double VectSharp.Colour.G |
double VectSharp.Colour.H |
double VectSharp.Colour.L |
double VectSharp.Colour.R |
double VectSharp.Colour.X |