예제 #1
0
파일: ColorTest.php 프로젝트: poef/ariadne
 /**
  * @covers toString
  */
 public function testToString()
 {
     $color = new ILess_Color('#ffeeaa');
     $this->assertEquals('#ffeeaa', $color->toString());
     // the format remains the same
     $color = new ILess_Color('#fea');
     $this->assertEquals('#ffeeaa', $color->toString());
     $color = new ILess_Color('#ff0000');
     $this->assertEquals('#ff0000', $color->toString());
     $this->assertEquals(255, $color->getRed());
     $this->assertEquals(0, $color->getGreen());
     $this->assertEquals(0, $color->getBlue());
     $color = new ILess_Color('#f60000');
     $this->assertEquals('#f60000', $color->toString());
     $this->assertEquals(246, $color->getRed());
     $this->assertEquals(0, $color->getGreen());
     $this->assertEquals(0, $color->getBlue());
 }
예제 #2
0
파일: Color.php 프로젝트: poef/ariadne
 /**
  * Converts the node to string
  *
  * @param ILess_Environment $env
  * @return string
  */
 public function toCSS(ILess_Environment $env)
 {
     return $this->color->toString($env->compress, $env->compress && $env->canShortenColors);
 }