Small ARGB color math helpers (the library never depends on a framework color type).

Static methods

staticinlinealphaOf(c:Int):Float

Extracts the alpha channel.

Parameters:

c

the ARGB color

Returns:

alpha as 0..1

staticinlinedarken(c:Int, f:Float):Int

Blends a color toward black, keeping its alpha.

Parameters:

c

the ARGB color

f

blend amount 0..1

Returns:

the darkened ARGB color

staticinlinelighten(c:Int, f:Float):Int

Blends a color toward white.

Parameters:

c

the ARGB color

f

blend amount 0..1

Returns:

the lightened ARGB color

staticmix(a:Int, b:Int, t:Float):Int

Linear blend between two ARGB colors.

Parameters:

a

the start color (0xAARRGGBB)

b

the end color

t

blend amount, 0 (all a) .. 1 (all b)

Returns:

the interpolated ARGB color

staticinlinergb(c:Int):Int

Drops the alpha channel, for APIs that take RGB + a separate alpha.

Parameters:

c

the ARGB color

Returns:

the 0xRRGGBB part