Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/general/libchart/classes/view/color/Color.php
Show All 33 Lines | |||||
/** | /** | ||||
* Creates a new color | * Creates a new color | ||||
* | * | ||||
* @param integer red [0..255] | * @param integer red [0..255] | ||||
* @param integer green [0..255] | * @param integer green [0..255] | ||||
* @param integer blue [0..255] | * @param integer blue [0..255] | ||||
* @param integer alpha [0..255] | * @param integer alpha [0..255] | ||||
*/ | */ | ||||
public function LibchartColor($red, $green, $blue, $alpha = 0) { | public function __construct($red, $green, $blue, $alpha = 0) { | ||||
$this->red = (int) $red; | $this->red = (int) $red; | ||||
$this->green = (int) $green; | $this->green = (int) $green; | ||||
$this->blue = (int) $blue; | $this->blue = (int) $blue; | ||||
$this->alpha = (int) round($alpha * 127.0 / 255); | $this->alpha = (int) round($alpha * 127.0 / 255); | ||||
$this->gdColor = null; | $this->gdColor = null; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
public function getShadowColor($shadowFactor) { | public function getShadowColor($shadowFactor) { | ||||
$red = $this->clip($this->red * $shadowFactor); | $red = $this->clip($this->red * $shadowFactor); | ||||
$green = $this->clip($this->green * $shadowFactor); | $green = $this->clip($this->green * $shadowFactor); | ||||
$blue = $this->clip($this->blue * $shadowFactor); | $blue = $this->clip($this->blue * $shadowFactor); | ||||
$shadowColor = new LibchartColor($red, $green, $blue); | $shadowColor = new LibchartColor($red, $green, $blue); | ||||
return $shadowColor; | return $shadowColor; | ||||
} | } | ||||
} | } | ||||
No newline at end of file |