Aspose.Barcode for PHP via Java Generation and Recognition API docs

Public Member Functions

 __construct (int $h, int $s, int $l, float $a)
 

Static Public Member Functions

static convertHslaToRgba (HslaColor $hslaColor)
 

Public Attributes

 $H
 
 $S
 
 $L
 
 $A = 0.0
 

Static Private Member Functions

static checkHue (int $value)
 
static checkSatLight (int $value)
 
static checkAlpha (float $value)
 
static hueToRgb (float $p, float $q, float $t)
 

Detailed Description

Class for representing HSLA color (Hue, Saturation, Lightness, Alpha)

Constructor & Destructor Documentation

◆ __construct()

HslaColor::__construct ( int  $h,
int  $s,
int  $l,
float  $a 
)

Constructor for HslaColor

Parameters
$hHue [0, 360]
$sSaturation [0, 100]
$lLightness [0, 100]
$aAlpha (opacity) [0.0f, 1.0f]

Member Function Documentation

◆ checkAlpha()

static HslaColor::checkAlpha ( float  $value)
staticprivate

◆ checkHue()

static HslaColor::checkHue ( int  $value)
staticprivate

◆ checkSatLight()

static HslaColor::checkSatLight ( int  $value)
staticprivate

◆ convertHslaToRgba()

static HslaColor::convertHslaToRgba ( HslaColor  $hslaColor)
static

Uses https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB

Parameters
hslaColorHSLA color to convert
Returns
string with RGBA values

◆ hueToRgb()

static HslaColor::hueToRgb ( float  $p,
float  $q,
float  $t 
)
staticprivate

Member Data Documentation

◆ $A

HslaColor::$A = 0.0

Alpha (opacity) [0.0f, 1.0f]

◆ $H

HslaColor::$H

Hue [0, 360]

◆ $L

HslaColor::$L

Lightness [0, 100]

◆ $S

HslaColor::$S

Saturation [0, 100]