Empeld
Empeld plugin documentation.
|
Class the represents a floating-point color of red, green, blue, and alpha More...
Public Member Functions | |
Rgba (Rgba c) | |
Initializes a new instance of the pluginbase.Helpers.Data.Rgba struct. More... | |
Rgba (float r, float g, float b) | |
Initializes a new instance of the pluginbase.Helpers.Data.Rgba struct. More... | |
Rgba (Rgba rgb, float a) | |
Initializes a new instance of the pluginbase.Helpers.Data.Rgba struct. More... | |
Rgba (float r, float g, float b, float a) | |
Initializes a new instance of the pluginbase.Helpers.Data.Rgba struct. More... | |
string | ToHex () |
Convert the Rgba instance to a 8-digit hex string More... | |
override string | ToString () |
Show the Rgba in a human-readable string format More... | |
byte [] | ToBytes () |
Convert Rgba instance to array of 4 bytes More... | |
void | Clamp (float min, float max) |
Clamp each component of Rgba to between min and max More... | |
void | Clamp () |
Clamp each component between 0 and 1 More... | |
void | ClampScale (float max) |
Clamp the Rgba instance, but in a way that scales down the rest of the colors eg, if you have 2.0,1.0,0.5,1.0, and ClampScale(1). You will get 1.0, 0.5, 0.25, 1.0 The alpha component does not follow the scaling More... | |
void | ClampScale () |
Clamp the Rgba instance, but in a way that scales down the rest of the colors eg, if you have 2.0,1.0,0.5,1.0, and ClampScale(1). You will get 1.0, 0.5, 0.25, 1.0 The alpha component does not follow the scaling More... | |
Rgba | Mix (Rgba with, float amt) |
Mix current color with an amount of a second color More... | |
Static Public Member Functions | |
static Rgba | FromBytes (byte[] bytes) |
Gets the Rgba instance of a 3 or 4-tuple byte array More... | |
static Rgba | FromBytes (byte r, byte g, byte b, byte a) |
Gets the Rgba from the byte-version of rgba More... | |
static Rgba | FromBytes (byte r, byte g, byte b) |
Gets the Rgba instaince from bytes RGB More... | |
static Rgba | FromBytes (int r, int g, int b, int a) |
Gets the Rgba instance from 0-255 range integers More... | |
static Rgba | FromBytes (int r, int g, int b) |
Gets the Rgba instance from 0-255 range integers More... | |
static Rgba | FromHexString (string hexString) |
Gets an Rgba instance from a 3,4,6,8 length hex string, including starting '#' eg #123, #1234, #11223344, #112233 More... | |
static implicit | operator Vector4 (Rgba color) |
Cast to a vector4 for easy conversion More... | |
static implicit | operator Rgba (Vector4 vec) |
Get a rgba instance from a vector More... | |
static | operator Rgba (float[] colors) |
Convert a 4-tuple float array to an Rgba instance More... | |
static Rgba | operator+ (Rgba v, Rgba w) |
Add instances More... | |
static Rgba | operator- (Rgba v, Rgba w) |
Subtract components More... | |
static Rgba | operator* (Rgba v, Rgba w) |
Multiply each component by its counterpart More... | |
static Rgba | operator* (Rgba v, float c) |
Multiply each component by a constant More... | |
static Rgba | operator* (float c, Rgba v) |
Multiply each component by a constant More... | |
static Rgba | operator/ (Rgba v, float c) |
Divide each component by a constant More... | |
Public Attributes | |
float | R |
Red component More... | |
float | G |
Green component More... | |
float | B |
Blue component More... | |
float | A |
Alpha component More... | |
Static Public Attributes | |
static readonly Rgba | Zero = new Rgba(0f, 0f, 0f, 0f) |
All-zeros (0,0,0,0) More... | |
static readonly Rgba | Black = new Rgba(0f, 0f, 0f, 1f) |
Black (0,0,0,1) More... | |
static readonly Rgba | White = new Rgba(1f, 1f, 1f, 1f) |
White (1,1,1,1) More... | |
static readonly Rgba | Gray = new Rgba(0.5f, 0.5f, 0.5f, 1f) |
Gray (0.5, 0.5, 0.5, 1) More... | |
static readonly Rgba | Transparent = new Rgba(0f, 0f, 0f, 0f) |
Transparent (0,0,0,0) More... | |
static readonly Rgba | Red = new Rgba(1f, 0f, 0f, 1f) |
Red (1,0,0,1) More... | |
static readonly Rgba | Green = new Rgba(0f, 1f, 0f, 1f) |
Green (0,1,0,1) More... | |
static readonly Rgba | Blue = new Rgba(0f, 0f, 1f, 1f) |
Blue (0,0,1,1) More... | |
Properties | |
Rgba | Grayscale [get] |
Get the average grayscale version of this color Alpha remains the same More... | |
float | Luminosity [get] |
Get the average luminosity, multiplied by alpha More... | |
float | LuminosityRgb [get] |
Get the luminosity of just the RGB components More... | |
float | LuminosityWeighted [get] |
Gets the human-eye corrected luminosity weights More... | |
float | LuminosityWeightedRgb [get] |
Gets the human-eye corrected RGB components, luminosity More... | |
Class the represents a floating-point color of red, green, blue, and alpha
Attribute: StructLayout(LayoutKind.Sequential, Pack = 1)
pluginbase.Helpers.Data.Rgba.Rgba | ( | Rgba | c | ) |
pluginbase.Helpers.Data.Rgba.Rgba | ( | float | r, |
float | g, | ||
float | b | ||
) |
Initializes a new instance of the pluginbase.Helpers.Data.Rgba struct.
r | The red component. |
g | The green component. |
b | The blue component. |
pluginbase.Helpers.Data.Rgba.Rgba | ( | Rgba | rgb, |
float | a | ||
) |
Initializes a new instance of the pluginbase.Helpers.Data.Rgba struct.
rgb | Rgb. |
a | The alpha component. |
pluginbase.Helpers.Data.Rgba.Rgba | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) |
Initializes a new instance of the pluginbase.Helpers.Data.Rgba struct.
r | The red component. |
g | The green component. |
b | The blue component. |
a | The alpha component. |
void pluginbase.Helpers.Data.Rgba.Clamp | ( | float | min, |
float | max | ||
) |
void pluginbase.Helpers.Data.Rgba.Clamp | ( | ) |
Clamp each component between 0 and 1
void pluginbase.Helpers.Data.Rgba.ClampScale | ( | float | max | ) |
Clamp the Rgba instance, but in a way that scales down the rest of the colors eg, if you have 2.0,1.0,0.5,1.0, and ClampScale(1). You will get 1.0, 0.5, 0.25, 1.0 The alpha component does not follow the scaling
max | Max. |
void pluginbase.Helpers.Data.Rgba.ClampScale | ( | ) |
Clamp the Rgba instance, but in a way that scales down the rest of the colors eg, if you have 2.0,1.0,0.5,1.0, and ClampScale(1). You will get 1.0, 0.5, 0.25, 1.0 The alpha component does not follow the scaling
|
static |
Gets the Rgba instance of a 3 or 4-tuple byte array
bytes | Bytes. |
Attribute: 0] / 255f, bytes[1] / 255f, bytes[2
/ 255f);
Attribute: 0] / 255f, bytes[1] / 255f, bytes[2] / 255f, bytes[3
/ 255f);
|
static |
Gets the Rgba from the byte-version of rgba
r | The red component. |
g | The green component. |
b | The blue component. |
a | The alpha component. |
|
static |
Gets the Rgba instaince from bytes RGB
r | The red component. |
g | The green component. |
b | The blue component. |
|
static |
Gets the Rgba instance from 0-255 range integers
r | The red component. |
g | The green component. |
b | The blue component. |
a | The alpha component. |
|
static |
Gets the Rgba instance from 0-255 range integers
r | The red component. |
g | The green component. |
b | The blue component. |
|
static |
Gets an Rgba instance from a 3,4,6,8 length hex string, including starting '#' eg #123, #1234, #11223344, #112233
hexString | Hex string. |
Attribute: 0
!= '#')
Attribute: 1
),
Attribute: 2
),
Attribute: 3
),
Attribute: 4
) : byte.MaxValue);
Attribute: 1], hexString[2
),
Attribute: 3], hexString[4
),
Attribute: 5], hexString[6
),
Attribute: 7], hexString[8
) : byte.MaxValue);
|
static |
Get a rgba instance from a vector
|
explicitstatic |
Convert a 4-tuple float array to an Rgba instance
Attribute: 0], colors[1], colors[2], colors[3
);
|
static |
Multiply each component by its counterpart
Multiply each component by a constant
Multiply each component by a constant
Add instances
Subtract components
Divide each component by a constant
byte [] pluginbase.Helpers.Data.Rgba.ToBytes | ( | ) |
string pluginbase.Helpers.Data.Rgba.ToHex | ( | ) |
Convert the Rgba instance to a 8-digit hex string
override string pluginbase.Helpers.Data.Rgba.ToString | ( | ) |
Show the Rgba in a human-readable string format
float pluginbase.Helpers.Data.Rgba.A |
Alpha component
float pluginbase.Helpers.Data.Rgba.B |
Blue component
float pluginbase.Helpers.Data.Rgba.G |
Green component
Gray (0.5, 0.5, 0.5, 1)
float pluginbase.Helpers.Data.Rgba.R |
Red component
Transparent (0,0,0,0)
All-zeros (0,0,0,0)
|
get |
Get the average grayscale version of this color Alpha remains the same
The grayscale.
|
get |
Get the average luminosity, multiplied by alpha
The luminosity.
|
get |
Get the luminosity of just the RGB components
The luminosity rgb.
|
get |
Gets the human-eye corrected luminosity weights
The luminosity weighted.
|
get |
Gets the human-eye corrected RGB components, luminosity
The luminosity weighted rgb.