/** * * @param Color $c * * @return string */ public function getColorValue(Color $c = null) { if ($c) { return $c->toString(); } return null; }
/** * Returns object properties as array * * @return array */ public function toArray() { $options = array(); if (isset($this->alpha)) { $options['backgroundAlpha'] = $this->alpha->getValue(); } if (isset($this->color)) { $options['backgroundColor'] = $this->color->toString(); } return $options; }
/** * Returns object properties as array * * @return array */ public function toArray() { $options = array(); if (isset($this->alpha)) { $options['borderAlpha'] = $this->alpha->getValue(); } if (isset($this->color)) { $options['borderColor'] = $this->color->toString(); } if (isset($this->thickness)) { $options['borderThickness'] = $this->thickness; } return $options; }
/** * @dataProvider colorProvider */ public function testColor($color, $hex) { $color = new Color($color); $this->assertEquals($hex, $color->toString()); }