abstract BGRA(UInt)
package lime.math
from Int, UInt, to Int, UInt
Available on all platforms
A utility for storing, accessing and converting colors in a BGRA (blue, green, red, alpha) color format.
var color:BGRA = 0x003388FF;
trace (color.b); // 0x00
trace (color.g); // 0x33
trace (color.r); // 0x88
trace (color.a); // 0xFF
var convert:ARGB = color; // 0xFF883300
Static variables
Static methods
staticinlinecreate(b:Int, g:Int, r:Int, a:Int):BGRA
Creates a new BGRA instance from component values
Parameters:
b | A blue component value |
---|---|
g | A green component value |
r | A red component value |
a | An alpha component value |
Returns:
A new BGRA instance
staticinlinemultiplyAlpha(this:UInt):Void
Multiplies the red, green and blue components by the current alpha component
staticinlinereadUInt8(this:UInt, data:UInt8Array, offset:Int, format:PixelFormat = RGBA32, premultiplied:Bool = false):Void
Reads a value from a UInt8Array
into the current BGRA
color
Parameters:
data | A |
---|---|
offset | An offset into the |
format | (Optional) The |
premultiplied | (Optional) Whether the data is stored in premultiplied alpha format |
staticinlineset(this:UInt, b:Int, g:Int, r:Int, a:Int):Void
Sets the current BGRA
color to new component values
Parameters:
b | The blue component vlaue to set |
---|---|
g | The green component value to set |
r | The red component value to set |
a | The alpha component value to set |
staticinlineunmultiplyAlpha(this:UInt):Void
Divides the current red, green and blue components by the alpha component
staticinlinewriteUInt8(this:UInt, data:UInt8Array, offset:Int, format:PixelFormat = RGBA32, premultiplied:Bool = false):Void
Writes the current BGRA
color into a UInt8Array
Parameters:
data | A |
---|---|
offset | An offset into the |
format | (Optional) The |
premultiplied | (Optional) Whether the data is stored in premultiplied alpha format |