/** * @param string $keyword */ public static function fromKeyword($keyword) { $keyword = strtolower($keyword); if (Less_Colors::hasOwnProperty($keyword)) { // detect named color return new Less_Tree_Color(substr(Less_Colors::color($keyword), 1)); } if ($keyword === 'transparent') { return new Less_Tree_Color(array(0, 0, 0), 0, true); } }
/** * @param string $keyword */ private function FromKeyword($keyword) { $keyword = strtolower($keyword); if (Less_Colors::hasOwnProperty($keyword)) { // detect named color return $this->NewObj1('Less_Tree_Color', substr(Less_Colors::color($keyword), 1)); } if ($keyword === 'transparent') { return $this->NewObj3('Less_Tree_Color', array(array(0, 0, 0), 0, true)); } }
private function parseEntitiesKeyword() { if ($k = $this->MatchReg('/\\G[_A-Za-z-][_A-Za-z0-9-]*/')) { if (Less_Colors::hasOwnProperty($k)) // detected named color return new Less_Tree_Color(substr(Less_Colors::color($k), 1)); else return new Less_Tree_Keyword($k); } return; }