color = $color; foreach ($color as $k => $v) { $self->$k = $v; } return $self; } /** * @return int */ public function getIndex() { return $this->index; } /** * @param int $index * * @return $this */ public function setIndex($index) { $this->index = $index; return $this; } /** * @return string */ public function getName() { return $this->name; } /** * @param string $name * * @return $this */ public function setName($name) { $this->name = $name; return $this; } public function genCSS($output) { $css = (new Less_Tree_Call( 'var', [ new Less_Tree_Keyword('--' . $this->getName()), // Use the Less_Tree_Color with which we created the ColorProp so that we don't get into genCSS() loops. $this->color ], $this->getIndex() ))->toCSS(); $output->add($css); } }