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

staticr:Int

Red color component from 0 to 255

staticg:Int

Green color component from 0 to 255

staticb:Int

Blue color component from 0 to 255

statica:Int

Alpha component from 0 (full transparent) to 255 (opaque)

staticrgb:Int

Get or set only the color channels into RGB byteorder

staticargb:Int

Get or set the color into ARGB byteorder

staticred:Int

Red color component from 0 to 255

staticgreen:Int

Green color component from 0 to 255

staticblue:Int

Blue color component from 0 to 255

staticalpha:Int

Alpha component from 0 (full transparent) to 255 (opaque)

staticluminance:Int

Luminance from 0 to 255, get: (r+g+b)/3, set: each color will set to this value

staticrF:Float

Red color component from 0.0 to 1.0

staticgF:Float

Green color component from 0.0 to 1.0

staticbF:Float

Blue color component from 0.0 to 1.0

staticaF:Float

Alpha component from 0.0 (full transparent) to 1.0 (opaque)

staticredF:Float

Red color component from 0.0 to 1.0

staticgreenF:Float

Green color component from 0.0 to 1.0

staticblueF:Float

Blue color component from 0.0 to 1.0

staticalphaF:Float

Alpha component from 0.0 (full transparent) to 1.0 (opaque)

staticluminanceF:Float

Luminance from 0.0 to 1.0, get: (r+g+b)/3, set: each color will set to this value

@:value(0x000000ff)staticinlineread onlyBLACK:Color = 0x000000ff

@:value(0xffffffff)staticinlineread onlyWHITE:Color = 0xffffffff

@:value(0xff0000ff)staticinlineread onlyRED:Color = 0xff0000ff

@:value(0x3f0000ff)staticinlineread onlyRED1:Color = 0x3f0000ff

@:value(0x7f0000ff)staticinlineread onlyRED2:Color = 0x7f0000ff

@:value(0xbf0000ff)staticinlineread onlyRED3:Color = 0xbf0000ff

@:value(0x00ff00ff)staticinlineread onlyGREEN:Color = 0x00ff00ff

@:value(0x003f00ff)staticinlineread onlyGREEN1:Color = 0x003f00ff

@:value(0x007f00ff)staticinlineread onlyGREEN2:Color = 0x007f00ff

@:value(0x00bf00ff)staticinlineread onlyGREEN3:Color = 0x00bf00ff

@:value(0x0000ffff)staticinlineread onlyBLUE:Color = 0x0000ffff

@:value(0x00003fff)staticinlineread onlyBLUE1:Color = 0x00003fff

@:value(0x00007fff)staticinlineread onlyBLUE2:Color = 0x00007fff

@:value(0x0000bfff)staticinlineread onlyBLUE3:Color = 0x0000bfff

@:value(0xffff00ff)staticinlineread onlyYELLOW:Color = 0xffff00ff

@:value(0xff00ffff)staticinlineread onlyMAGENTA:Color = 0xff00ffff

@:value(0x00ffffff)staticinlineread onlyCYAN:Color = 0x00ffffff

@:value(0x222222ff)staticinlineread onlyGREY1:Color = 0x222222ff

@:value(0x444444ff)staticinlineread onlyGREY2:Color = 0x444444ff

@:value(0x666666ff)staticinlineread onlyGREY3:Color = 0x666666ff

@:value(0x888888ff)staticinlineread onlyGREY4:Color = 0x888888ff

@:value(0xaaaaaaff)staticinlineread onlyGREY5:Color = 0xaaaaaaff

@:value(0xccccccff)staticinlineread onlyGREY6:Color = 0xccccccff

@:value(0xeeeeeeff)staticinlineread onlyGREY7:Color = 0xeeeeeeff

@:value(0xffd700ff)staticinlineread onlyGOLD:Color = 0xffd700ff

@:value(0xffa500ff)staticinlineread onlyORANGE:Color = 0xffa500ff

@:value(0xccff00ff)staticinlineread onlyLIME:Color = 0xccff00ff

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.