Пример #1
0
 /**
  *
  * @param Color $c
  *
  * @return string
  */
 public function getColorValue(Color $c = null)
 {
     if ($c) {
         return $c->toString();
     }
     return null;
 }
Пример #2
0
 /**
  * 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;
 }
Пример #3
0
 /**
  * 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;
 }
Пример #4
0
 /**
  * @dataProvider colorProvider
  */
 public function testColor($color, $hex)
 {
     $color = new Color($color);
     $this->assertEquals($hex, $color->toString());
 }