LiveMap API
Loading...
Searching...
No Matches
livemap.data.Color Struct Reference

Represents a 24 bit Color. More...

Public Member Functions

 Color (string value)
 Create a new Color from string.
 Color (double[] value)
 Create a new Color from double array.
 Color (double r, double g, double b)
 Create a new Color from double values.
 Color (double a, double r, double g, double b)
 Create a new Color from double values.
 Color (uint r, uint g, uint b)
 Create a new Color from uint values.
 Color (uint a, uint r, uint g, uint b)
 Create a new Color from uint values.
 Color (uint value)
 Create a new Color from uint.
uint ToUInt ()
 Returns the uint value of this Color.
override string ToString ()
 Returns the string hex value of this Color.
string ToString (bool alpha)
 Returns the string hex value of this Color.
uint Alpha ()
uint Red ()
uint Green ()
uint Blue ()
Color Alpha (uint alpha)

Static Public Member Functions

static implicit operator Color (string value)
 Implicit cast string to Color.
static implicit operator Color (uint value)
 Implicit cast uint to Color.
static implicit operator string (Color color)
 Implicit cast Color to string.
static implicit operator uint (Color color)
 Implicit cast Color to uint.
static uint Parse (string value)
 Parse a string representation of a Color into a uint value.
static Color Reverse (Color color)
static Color Blend (Color color0, Color color1, float ratio)
static Color LerpHsb (Color color0, Color color1, float delta)
static float[] Rgb2Hsb (uint red, uint green, uint blue)
static Color Hsb2Rgb (float hue, float saturation, float brightness)

Detailed Description

Represents a 24 bit Color.

Constructor & Destructor Documentation

◆ Color() [1/7]

livemap.data.Color.Color ( string value)
inline

Create a new Color from string.

Parameters
valuethe uint value of the Color ("#RRGGBB")

◆ Color() [2/7]

livemap.data.Color.Color ( double[] value)
inline

Create a new Color from double array.

Parameters
valuethe double array value of the Color ("[r, g, b, a]")

◆ Color() [3/7]

livemap.data.Color.Color ( double r,
double g,
double b )
inline

Create a new Color from double values.

Parameters
rthe double value for red (0.0 - 1.0)
gthe double value for green (0.0 - 1.0)
bthe double value for blue (0.0 - 1.0)

◆ Color() [4/7]

livemap.data.Color.Color ( double a,
double r,
double g,
double b )
inline

Create a new Color from double values.

Parameters
athe double value for alpha (0.0 - 1.0)
rthe double value for red (0.0 - 1.0)
gthe double value for green (0.0 - 1.0)
bthe double value for blue (0.0 - 1.0)

◆ Color() [5/7]

livemap.data.Color.Color ( uint r,
uint g,
uint b )
inline

Create a new Color from uint values.

Parameters
rthe uint value for red (0x0 - 0xFF)
gthe uint value for green (0x0 - 0xFF)
bthe uint value for blue (0x0 - 0xFF)

◆ Color() [6/7]

livemap.data.Color.Color ( uint a,
uint r,
uint g,
uint b )
inline

Create a new Color from uint values.

Parameters
athe uint value for alpha (0x0 - 0xFF)
rthe uint value for red (0x0 - 0xFF)
gthe uint value for green (0x0 - 0xFF)
bthe uint value for blue (0x0 - 0xFF)

◆ Color() [7/7]

livemap.data.Color.Color ( uint value)
inline

Create a new Color from uint.

Parameters
valuethe uint value of the Color (0xRRGGBB)

Member Function Documentation

◆ Alpha() [1/2]

uint livemap.data.Color.Alpha ( )

◆ Alpha() [2/2]

Color livemap.data.Color.Alpha ( uint alpha)

◆ Blend()

Color livemap.data.Color.Blend ( Color color0,
Color color1,
float ratio )
inlinestatic

◆ Blue()

uint livemap.data.Color.Blue ( )

◆ Green()

uint livemap.data.Color.Green ( )

◆ Hsb2Rgb()

Color livemap.data.Color.Hsb2Rgb ( float hue,
float saturation,
float brightness )
inlinestatic

◆ LerpHsb()

Color livemap.data.Color.LerpHsb ( Color color0,
Color color1,
float delta )
inlinestatic

◆ operator Color() [1/2]

implicit livemap.data.Color.operator Color ( string value)
static

Implicit cast string to Color.

Parameters
valuethe string to cast
Returns
Color parsed from string

◆ operator Color() [2/2]

implicit livemap.data.Color.operator Color ( uint value)
static

Implicit cast uint to Color.

Parameters
valuethe uint to cast
Returns
Color parsed from uint

◆ operator string()

implicit livemap.data.Color.operator string ( Color color)
static

Implicit cast Color to string.

Parameters
colorthe Color to cast
Returns
string representation of this Color in the format of "#RRGGBB"

◆ operator uint()

implicit livemap.data.Color.operator uint ( Color color)
static

Implicit cast Color to uint.

Parameters
colorthe Color to cast
Returns
uint representation of this Color in the format of 0xRRGGBB

◆ Parse()

uint livemap.data.Color.Parse ( string value)
inlinestatic

Parse a string representation of a Color into a uint value.

Parameters
value
Returns
Color parsed from string

◆ Red()

uint livemap.data.Color.Red ( )

◆ Reverse()

Color livemap.data.Color.Reverse ( Color color)
inlinestatic

◆ Rgb2Hsb()

float[] livemap.data.Color.Rgb2Hsb ( uint red,
uint green,
uint blue )
inlinestatic

◆ ToString() [1/2]

override string livemap.data.Color.ToString ( )

Returns the string hex value of this Color.

Returns
string hex value

◆ ToString() [2/2]

string livemap.data.Color.ToString ( bool alpha)
inline

Returns the string hex value of this Color.

Returns
string hex value

◆ ToUInt()

uint livemap.data.Color.ToUInt ( )

Returns the uint value of this Color.

Returns
uint Color value

The documentation for this struct was generated from the following file: