test.php

  1. <?php
  2.  
  3. require_once('color.php');
  4.  
  5. ansi::set_color('red');
  6. echo 'Text will be red until futher notice.', "\n",
  7. 'Although it makes newlines look a bit shit with...', "\n";
  8. ansi::set_color(FALSE, 'blue');
  9. echo 'Background colors. Ewww!', "\n",
  10. 'This is pretty horrible, right? Let\'s go back to ...';
  11.  
  12. ansi::set_color();
  13.  
  14. echo "\nNormal! Phew. This text looks better.\n";
  15.  
  16. $colored = ansi::csprintf('blue', FALSE, 'Here\'s some blue text with %d format code in it.', 1);
  17.  
  18. echo 'Regular text...', $colored, "\n";
  19. echo "The end!\n";
  20.