public function __construct($mColor = null) { parent::__construct('rgb', null); if (is_array($mColor)) { if (isset($mColor['r'], $mColor['g'], $mColor['b'])) { $this->fromRGB($mColor); } else { if (isset($mColor['h'], $mColor['s'], $mColor['l'])) { $this->fromHSL($mColor); } } } else { if (is_string($mColor)) { if ($aRGB = CSSColorUtils::namedColor2rgb($mColor)) { $this->fromRGB($aRGB); } else { if ($aRGB = CSSColorUtils::hex2rgb($mColor)) { $this->fromRGB($aRGB); } } } } }
public function __construct($aColor) { parent::__construct(implode('', array_keys($aColor)), $aColor); }
public function __construct($aColor, $iLineNo = 0) { parent::__construct(implode('', array_keys($aColor)), $aColor, ',', $iLineNo); }