Color

php\swing\Color

Properties


property rgb

int

read-only

property alpha

int

read-only

property red

int

read-only

property green

int

read-only

property blue

int

read-only

Methods


__construct($rgb, $hasAlpha = false)
Parameters:
  • $rgbint
  • $hasAlphabool
darker()

Creates a new Color that is a darker version of this

Returns:php\swing\Color
brighter()

Creates a new Color that is a brighter version of this

Returns:php\swing\Color
static rgb($r, $g, $b, $alpha = 255)
Parameters:
  • $rint - - 0 .. 255
  • $gint - - 0 .. 255
  • $bint - - 0 .. 255
  • $alphaint - - 0 .. 255
Returns:

php\swing\Color

static floatRgb($r, $g, $b, $alpha = 1.0)
Parameters:
  • $rdouble - - between 0 and 1
  • $gdouble - - between 0 and 1
  • $bdouble - - between 0 and 1
  • $alphadouble - - between 0 and 1
Returns:

php\swing\Color

static decode($nm)

Decode color from a hex string (#RGB, 0xRGB, etc...)

Parameters:
  • $nm
Returns:

php\swing\Color