Represents a color value what is stored inside a 32 bit integer.
The supported format is RGBA
, so it uses one Byte
per red
, green
, blue
and alpha
channel into order.
Static variables
staticluminanceF:Float
Luminance from 0.0 to 1.0, get: (r+g+b)/3, set: each color will set to this value
Static methods
staticinlinesetARGB(this:Int, a:Int, r:Int, g:Int, b:Int):Color
Set multiple components by integers (0 to 255) and return the resulting color.
Parameters:
a | alpha |
---|---|
r | red |
g | green |
b | blue |
staticinlinesetRGBA(this:Int, r:Int, g:Int, b:Int, a:Int):Color
Set multiple components by integers (0 to 255) and return the resulting color.
Parameters:
r | red |
---|---|
g | green |
b | blue |
a | alpha |
staticinlinesetRGB(this:Int, r:Int, g:Int, b:Int):Color
Set multiple components by integers (0 to 255) and return the resulting color.
Parameters:
r | red |
---|---|
g | green |
b | blue |
staticinlinesetLuminanceAlpha(this:Int, lum:Int, a:Int):Color
Set multiple components by integers (0 to 255) and return the resulting color.
Parameters:
lum | luminance |
---|---|
a | alpha |
staticinlinesetRed(this:Int, r:Int):Color
Set red color by integer (0 to 255) and return the resulting color.
Parameters:
r | red |
---|
staticinlinesetGreen(this:Int, g:Int):Color
Set green color by integer (0 to 255) and return the resulting color.
Parameters:
g | green |
---|
staticinlinesetBlue(this:Int, b:Int):Color
Set blue color by integer (0 to 255) and return the resulting color.
Parameters:
b | blue |
---|
staticinlinesetAlpha(this:Int, a:Int):Color
Set alpha by integer (0 to 255) and return the resulting color.
Parameters:
a | alpha |
---|
staticinlinesetLuminance(this:Int, lum:Int):Color
Set luminance by integer (0 to 255) and return the resulting color.
Parameters:
lum | luminance |
---|
staticinlinesetFloatARGB(this:Int, a:Float, r:Float, g:Float, b:Float):Color
Set multiple components by float values (0.0 to 1.0) and return the resulting color.
Parameters:
a | alpha |
---|---|
r | red |
g | green |
b | blue |
staticinlinesetFloatRGBA(this:Int, r:Float, g:Float, b:Float, a:Float):Color
Set multiple components by float values (0.0 to 1.0) and return the resulting color.
Parameters:
r | red |
---|---|
g | green |
b | blue |
a | alpha |
staticinlinesetFloatRGB(this:Int, r:Float, g:Float, b:Float):Color
Set multiple components by float values (0.0 to 1.0) and return the resulting color.
Parameters:
r | red |
---|---|
g | green |
b | blue |
staticinlinesetFloatLuminanceAlpha(this:Int, lum:Float, a:Float):Color
Set multiple components by float values (0.0 to 1.0) and return the resulting color.
Parameters:
lum | luminance |
---|---|
a | alpha |
staticinlinesetFloatRed(this:Int, r:Float):Color
Set red color by float value (0.0 to 1.0) and return the resulting color.
Parameters:
r | red |
---|
staticinlinesetFloatGreen(this:Int, g:Float):Color
Set green color by float value (0.0 to 1.0) and return the resulting color.
Parameters:
g | green |
---|
staticinlinesetFloatBlue(this:Int, b:Float):Color
Set blue color by float value (0.0 to 1.0) and return the resulting color.
Parameters:
b | blue |
---|
staticinlinesetFloatAlpha(this:Int, a:Float):Color
Set alpha by float value (0.0 to 1.0) and return the resulting color.
Parameters:
a | alpha |
---|
staticinlinesetFloatLuminance(this:Int, lum:Float):Color
Set luminance by float value (0.0 to 1.0) and return the resulting color.
Parameters:
lum | luminance |
---|
staticinlineARGB(a:Int, r:Int, g:Int, b:Int):Color
Create a new color by integers (0 to 255).
Parameters:
a | alpha |
---|---|
r | red |
g | green |
b | blue |
staticinlineRGBA(r:Int, g:Int, b:Int, a:Int):Color
Create a new color by integers (0 to 255).
Parameters:
r | red |
---|---|
g | green |
b | blue |
a | alpha |
staticinlineRGB(r:Int, g:Int, b:Int):Color
Create a new color by integers (0 to 255).
Parameters:
r | red |
---|---|
g | green |
b | blue |
staticinlineLuminanceAlpha(lum:Int, a:Int):Color
Create a new color by integers (0 to 255).
Parameters:
lum | luminance |
---|---|
a | alpha |
staticinlineRed(r:Int):Color
Create a new color by set the red value as integer (0 to 255).
Parameters:
r | red |
---|
staticinlineGreen(g:Int):Color
Create a new color by set the green value as integer (0 to 255).
Parameters:
g | green |
---|
staticinlineBlue(b:Int):Color
Create a new color by set the blue value as integer (0 to 255).
Parameters:
b | blue |
---|
staticinlineAlpha(a:Int):Color
Create a new color by set the alpha value as integer (0 to 255).
Parameters:
a | alpha |
---|
staticinlineLuminance(lum:Int):Color
Create a new color by set the luminance value as integer (0 to 255).
Parameters:
lum | luminance |
---|
staticinlineFloatARGB(a:Float, r:Float, g:Float, b:Float):Color
Create a new color by float values (0.0 to 1.0).
Parameters:
a | alpha |
---|---|
r | red |
g | green |
b | blue |
staticinlineFloatRGBA(r:Float, g:Float, b:Float, a:Float):Color
Create a new color by float values (0.0 to 1.0).
Parameters:
r | red |
---|---|
g | green |
b | blue |
a | alpha |
staticinlineFloatRGB(r:Float, g:Float, b:Float):Color
Create a new color by float values (0.0 to 1.0).
Parameters:
r | red |
---|---|
g | green |
b | blue |
staticinlineFloatLuminanceAlpha(lum:Float, a:Float):Color
Create a new color by float values (0.0 to 1.0).
Parameters:
lum | luminance |
---|---|
a | alpha |
staticinlineFloatRed(r:Float):Color
Create a new color by set the red value as float (0.0 to 1.0).
Parameters:
r | red |
---|
staticinlineFloatGreen(g:Float):Color
Create a new color by set the green value as float (0.0 to 1.0).
Parameters:
g | green |
---|
staticinlineFloatBlue(b:Float):Color
Create a new color by set the blue value as float (0.0 to 1.0).
Parameters:
b | blue |
---|
staticinlineFloatAlpha(a:Float):Color
Create a new color by set the alpha value as float (0.0 to 1.0).
Parameters:
a | alpha |
---|
staticinlineFloatLuminance(lum:Float):Color
Create a new color by set the luminance value as float (0.0 to 1.0).
Parameters:
lum | luminance |
---|
staticinlinerandom(?alpha:Int):Color
Create a random color.
Parameters:
alpha | to set a value for alpha (by default it is also randomized) |
---|
staticinlinerandomize(this:Int, ?alpha:Int):Void
Set the color to a random value.
Parameters:
alpha | to set a value for alpha (by default it is also randomized) |
---|
staticinlinetoGLSL(this:Int):String
To create a string where the color is defined as vec4(...)
to use inside of glsl-code.