Example #1
0
 /**
  * @dataProvider exactHexCodes
  */
 public function testExactHexCodeInputs($hex, $gcode)
 {
     $color = Xterm256::calculate($hex);
     $r = new ReflectionClass($color);
     $gcode = sprintf('%%s;5;%s', $gcode);
     $this->assertEquals($gcode, $r->getStaticPropertyValue('color'));
 }
Example #2
0
 /**
  * Display an error message using red color on the console to make it
  * easier to spot.
  *
  * @param string $error
  * @returns RendererInterface
  */
 public function error($error)
 {
     echo PHP_EOL;
     $this->console->writeLine('ERROR: ' . $error . PHP_EOL, Color::calculate('ff0000'));
     echo PHP_EOL;
     return $this;
 }