Loading...
Searching...
No Matches
Color Interface Reference
Inheritance diagram for Color:
Managed

Public Member Functions

void Color (float red=0.0, float green=0.0, float blue=0.0, float alpha=0.0)
 
proto ref Color Copy ()
 Creates a new color instance from Color object.
 
proto external float R ()
 Returns Red component.
 
proto external float G ()
 Returns Green component.
 
proto external float B ()
 Returns Blue component.
 
proto external float A ()
 Returns Alpha component.
 
proto external void SetR (float red)
 Sets the Red component.
 
proto external void SetG (float green)
 Sets the Green component.
 
proto external void SetB (float blue)
 Sets the Blue component.
 
proto external void SetA (float alpha)
 Sets the Alpha component.
 
proto external void SetFromInt (int color)
 Sets the color to color given in packed ARGB integer.
 
proto external void Add (Color other)
 Component-wise addition-assignment.
 
proto ref Color AddNew (Color other)
 Component-wise addition returns result as a new color.
 
proto external void Sub (Color other)
 Component-wise subtraction-assignment.
 
proto ref Color SubNew (Color other)
 Component-wise subtraction returns result as a new color.
 
proto external void Mul (Color other)
 Component-wise multiplication-assignment.
 
proto ref Color MulNew (Color other)
 Component-wise multiplication returns result as a new color.
 
proto external void Div (Color other)
 Component-wise division-assignment.
 
proto ref Color DivNew (Color other)
 Component-wise division returns result as a new color.
 
proto external void Scale (float scale)
 Multiplies each component by scale
 
proto external float GetLuminance ()
 Returns perceptual brightness.
 
proto external void Saturate ()
 Clamps each component to [0, 1] range.
 
proto external void Clamp (float min, float max)
 Clamps each component to [min, max] range.
 
proto external void Lerp (Color other, float t)
 Linear interpolation with other based on t.
 
proto ref Color LerpNew (Color other, float t)
 
proto external int PackToInt ()
 Returs this color as integer with 8 bits per channel.
 
proto external void SRGBToLinear ()
 Converts this color from sRGB color space to linear RGB color space.
 
proto external void LinearToSRGB ()
 Converts this color from linear RGB color space to sRGB color space.
 
proto external bool IsZero ()
 Returns true if all the components are zero.
 
proto external bool IsEqual (Color other, float epsilon=0.0)
 Returns true if the colors differ by at most epsilon in each component.
 
- Public Member Functions inherited from Managed
proto external ref Managed Clone ()
 Return shallow copy of object, or null if it is not allowed (not public constructor)
 

Static Public Member Functions

static proto ref Color FromInt (int color)
 Creates a new color instance from ARGB color packed in int.
 
static proto ref Color FromVector (vector color)
 Creates a new color instance from RGB vector.
 
static proto ref Color FromRGBA (int r, int g, int b, int a)
 Creates a new color instance from RGBA integers in range 0-255.
 
static proto ref Color FromIntSRGB (int color)
 Creates a new color instance in linear color space from ARGB color packed in int which is in sRGB color space.
 
static proto ref Color FromSRGBA (int r, int g, int b, int a)
 Creates a new color instance in linear color space from RGBA integers in range 0-255 which are in sRGB color space.
 
static proto void UnpackInt (int argb, out int a, out int r, out int g, out int b)
 Unpack color data from packed integer, see PackToInt().
 

Static Public Attributes

static const ref Color Black = new Color(0.0, 0.0, 0.0, 1.0)
 color constants - color objects
 
static const ref Color Gray25 = new Color(0.25, 0.25, 0.25, 1.0)
 
static const ref Color Gray = new Color(0.5, 0.5, 0.5, 1.0)
 
static const ref Color Gray75 = new Color(0.75, 0.75, 0.75, 1.0)
 
static const ref Color White = new Color(1.0, 1.0, 1.0, 1.0)
 
static const ref Color Red = new Color(1.0, 0.0, 0.0, 1.0)
 
static const ref Color Green = new Color(0.0, 1.0, 0.0, 1.0)
 
static const ref Color Blue = new Color(0.0, 0.0, 1.0, 1.0)
 
static const ref Color DarkRed = new Color(0.5, 0.0, 0.0, 1.0)
 
static const ref Color DarkGreen = new Color(0.0, 0.5, 0.0, 1.0)
 
static const ref Color DarkBlue = new Color(0.0, 0.0, 0.5, 1.0)
 
static const ref Color Cyan = new Color(0.0, 1.0, 1.0, 1.0)
 
static const ref Color Magenta = new Color(1.0, 0.0, 1.0, 1.0)
 
static const ref Color Yellow = new Color(1.0, 1.0, 0.0, 1.0)
 
static const ref Color DarkCyan = new Color(0.0, 0.5, 0.5, 1.0)
 
static const ref Color DarkMagenta = new Color(0.5, 0.0, 0.5, 1.0)
 
static const ref Color DarkYellow = new Color(0.5, 0.5, 0.0, 1.0)
 
static const ref Color Orange = new Color(1.0, 0.5, 0.0, 1.0)
 
static const ref Color Chartreuse = new Color(0.5, 1.0, 0.0, 1.0)
 
static const ref Color SpringGreen = new Color(0.0, 1.0, 0.5, 1.0)
 
static const ref Color DodgerBlue = new Color(0.0, 0.5, 1.0, 1.0)
 
static const ref Color Violet = new Color(0.5, 0.0, 1.0, 1.0)
 
static const ref Color Pink = new Color(1.0, 0.0, 0.5, 1.0)
 
Constants

Populated by the engine.

static const int BLACK
 color constants - hex codes
 
static const int GRAY_25
 
static const int GRAY
 
static const int GRAY_75
 
static const int WHITE
 
static const int RED
 
static const int GREEN
 
static const int BLUE
 
static const int DARK_RED
 
static const int DARK_GREEN
 
static const int DARK_BLUE
 
static const int CYAN
 
static const int MAGENTA
 
static const int YELLOW
 
static const int DARK_CYAN
 
static const int DARK_MAGENTA
 
static const int DARK_YELLOW
 
static const int ORANGE
 
static const int CHARTREUSE
 
static const int SPRING_GREEN
 
static const int DODGER_BLUE
 
static const int VIOLET
 
static const int PINK
 

Constructor & Destructor Documentation

◆ Color()

void Color.Color ( float red = 0.0,
float green = 0.0,
float blue = 0.0,
float alpha = 0.0 )

Member Function Documentation

◆ A()

proto external float Color.A ( )

Returns Alpha component.

◆ Add()

proto external void Color.Add ( Color other)

Component-wise addition-assignment.

◆ AddNew()

proto ref Color Color.AddNew ( Color other)

Component-wise addition returns result as a new color.

◆ B()

proto external float Color.B ( )

Returns Blue component.

◆ Clamp()

proto external void Color.Clamp ( float min,
float max )

Clamps each component to [min, max] range.

◆ Copy()

proto ref Color Color.Copy ( )

Creates a new color instance from Color object.

◆ Div()

proto external void Color.Div ( Color other)

Component-wise division-assignment.

◆ DivNew()

proto ref Color Color.DivNew ( Color other)

Component-wise division returns result as a new color.

◆ FromInt()

static proto ref Color Color.FromInt ( int color)
static

Creates a new color instance from ARGB color packed in int.

◆ FromIntSRGB()

static proto ref Color Color.FromIntSRGB ( int color)
static

Creates a new color instance in linear color space from ARGB color packed in int which is in sRGB color space.

◆ FromRGBA()

static proto ref Color Color.FromRGBA ( int r,
int g,
int b,
int a )
static

Creates a new color instance from RGBA integers in range 0-255.

◆ FromSRGBA()

static proto ref Color Color.FromSRGBA ( int r,
int g,
int b,
int a )
static

Creates a new color instance in linear color space from RGBA integers in range 0-255 which are in sRGB color space.

◆ FromVector()

static proto ref Color Color.FromVector ( vector color)
static

Creates a new color instance from RGB vector.

◆ G()

proto external float Color.G ( )

Returns Green component.

◆ GetLuminance()

proto external float Color.GetLuminance ( )

Returns perceptual brightness.

◆ IsEqual()

proto external bool Color.IsEqual ( Color other,
float epsilon = 0.0 )

Returns true if the colors differ by at most epsilon in each component.

◆ IsZero()

proto external bool Color.IsZero ( )

Returns true if all the components are zero.

◆ Lerp()

proto external void Color.Lerp ( Color other,
float t )

Linear interpolation with other based on t.

Returns this + (other - this) * t.

◆ LerpNew()

proto ref Color Color.LerpNew ( Color other,
float t )
See also
Lerp
Returns
result as a new color

◆ LinearToSRGB()

proto external void Color.LinearToSRGB ( )

Converts this color from linear RGB color space to sRGB color space.

◆ Mul()

proto external void Color.Mul ( Color other)

Component-wise multiplication-assignment.

◆ MulNew()

proto ref Color Color.MulNew ( Color other)

Component-wise multiplication returns result as a new color.

◆ PackToInt()

proto external int Color.PackToInt ( )

Returs this color as integer with 8 bits per channel.

◆ R()

proto external float Color.R ( )

Returns Red component.

◆ Saturate()

proto external void Color.Saturate ( )

Clamps each component to [0, 1] range.

◆ Scale()

proto external void Color.Scale ( float scale)

Multiplies each component by scale

◆ SetA()

proto external void Color.SetA ( float alpha)

Sets the Alpha component.

◆ SetB()

proto external void Color.SetB ( float blue)

Sets the Blue component.

◆ SetFromInt()

proto external void Color.SetFromInt ( int color)

Sets the color to color given in packed ARGB integer.

◆ SetG()

proto external void Color.SetG ( float green)

Sets the Green component.

◆ SetR()

proto external void Color.SetR ( float red)

Sets the Red component.

◆ SRGBToLinear()

proto external void Color.SRGBToLinear ( )

Converts this color from sRGB color space to linear RGB color space.

◆ Sub()

proto external void Color.Sub ( Color other)

Component-wise subtraction-assignment.

◆ SubNew()

proto ref Color Color.SubNew ( Color other)

Component-wise subtraction returns result as a new color.

◆ UnpackInt()

static proto void Color.UnpackInt ( int argb,
out int a,
out int r,
out int g,
out int b )
static

Unpack color data from packed integer, see PackToInt().

Parameters
argbinput packed argb int
aout alpha channel <0..255>
rout red channel <0..255>
gout green channel <0..255>
bout blue channel <0..255>

Member Data Documentation

◆ BLACK

const int Color.BLACK
static

color constants - hex codes

◆ Black

const ref Color Color.Black = new Color(0.0, 0.0, 0.0, 1.0)
static

color constants - color objects

◆ BLUE

const int Color.BLUE
static

◆ Blue

const ref Color Color.Blue = new Color(0.0, 0.0, 1.0, 1.0)
static

◆ CHARTREUSE

const int Color.CHARTREUSE
static

◆ Chartreuse

const ref Color Color.Chartreuse = new Color(0.5, 1.0, 0.0, 1.0)
static

◆ CYAN

const int Color.CYAN
static

◆ Cyan

const ref Color Color.Cyan = new Color(0.0, 1.0, 1.0, 1.0)
static

◆ DARK_BLUE

const int Color.DARK_BLUE
static

◆ DARK_CYAN

const int Color.DARK_CYAN
static

◆ DARK_GREEN

const int Color.DARK_GREEN
static

◆ DARK_MAGENTA

const int Color.DARK_MAGENTA
static

◆ DARK_RED

const int Color.DARK_RED
static

◆ DARK_YELLOW

const int Color.DARK_YELLOW
static

◆ DarkBlue

const ref Color Color.DarkBlue = new Color(0.0, 0.0, 0.5, 1.0)
static

◆ DarkCyan

const ref Color Color.DarkCyan = new Color(0.0, 0.5, 0.5, 1.0)
static

◆ DarkGreen

const ref Color Color.DarkGreen = new Color(0.0, 0.5, 0.0, 1.0)
static

◆ DarkMagenta

const ref Color Color.DarkMagenta = new Color(0.5, 0.0, 0.5, 1.0)
static

◆ DarkRed

const ref Color Color.DarkRed = new Color(0.5, 0.0, 0.0, 1.0)
static

◆ DarkYellow

const ref Color Color.DarkYellow = new Color(0.5, 0.5, 0.0, 1.0)
static

◆ DODGER_BLUE

const int Color.DODGER_BLUE
static

◆ DodgerBlue

const ref Color Color.DodgerBlue = new Color(0.0, 0.5, 1.0, 1.0)
static

◆ GRAY

const int Color.GRAY
static

◆ Gray

const ref Color Color.Gray = new Color(0.5, 0.5, 0.5, 1.0)
static

◆ Gray25

const ref Color Color.Gray25 = new Color(0.25, 0.25, 0.25, 1.0)
static

◆ Gray75

const ref Color Color.Gray75 = new Color(0.75, 0.75, 0.75, 1.0)
static

◆ GRAY_25

const int Color.GRAY_25
static

◆ GRAY_75

const int Color.GRAY_75
static

◆ GREEN

const int Color.GREEN
static

◆ Green

const ref Color Color.Green = new Color(0.0, 1.0, 0.0, 1.0)
static

◆ MAGENTA

const int Color.MAGENTA
static

◆ Magenta

const ref Color Color.Magenta = new Color(1.0, 0.0, 1.0, 1.0)
static

◆ ORANGE

const int Color.ORANGE
static

◆ Orange

const ref Color Color.Orange = new Color(1.0, 0.5, 0.0, 1.0)
static

◆ PINK

const int Color.PINK
static

◆ Pink

const ref Color Color.Pink = new Color(1.0, 0.0, 0.5, 1.0)
static

◆ RED

const int Color.RED
static

◆ Red

const ref Color Color.Red = new Color(1.0, 0.0, 0.0, 1.0)
static

◆ SPRING_GREEN

const int Color.SPRING_GREEN
static

◆ SpringGreen

const ref Color Color.SpringGreen = new Color(0.0, 1.0, 0.5, 1.0)
static

◆ VIOLET

const int Color.VIOLET
static

◆ Violet

const ref Color Color.Violet = new Color(0.5, 0.0, 1.0, 1.0)
static

◆ WHITE

const int Color.WHITE
static

◆ White

const ref Color Color.White = new Color(1.0, 1.0, 1.0, 1.0)
static

◆ YELLOW

const int Color.YELLOW
static

◆ Yellow

const ref Color Color.Yellow = new Color(1.0, 1.0, 0.0, 1.0)
static

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