Home Contents | # gcx:color | Graphics | Core4 Lua Commands

## SYNOPSIS

1. gcx:color([rgb])
2. gcx:bgcolor([rgb])

## DESCRIPTION

If specified, rgb makes the graphics context gcx use it as the foreground or background color for further painting.
With no arguments, returns the color currently used by gcx.

All color values are specified as ARGB, a 32 bit value with the top 8 bits specifying an alpha channel, the next 8 bits giving the red, then the green and the lowest eight bits the blue value (0xAARRGGBB):

31 .. 24 | 23 .. 16 | 15 .. 8 | 7 .. 0
Alpha | Red | Green | Blue

## RETURN VALUE

The current foreground or background color, respectively, which is currently used by gcx.

## ERRORS

Raises an error if gcx is not a graphics context.

## EXAMPLE

>
gcx:color(0xFFFFFF)
>
gcx:bgcolor(0x008080)

## SEE ALSO

gcx:box, gcx:circle, gcx:cls, gcx:fillcircle, gcx:fill, gcx:line, gcx:pixel, gcx:plot, gcx:text