Console_Color2
[ class tree: Console_Color2 ] [ index: Console_Color2 ] [ all elements ]

Source for file color_example.php

Documentation is available at color_example.php

  1. <?php
  2. require 'Console/Color2.php';
  3.  
  4. $color = new Console_Color2();
  5.  
  6. // Let's add a little color to the world
  7. // %n resets the color so the following stuff doesn't get messed up
  8. print $color->convert("%bHello World!%n\n")
  9. // Colorless mode, in case you need to strip colorcodes off a text
  10. print $color->convert("%rHello World!%n\n"false);
  11. // The uppercase version makes a colorcode bold/bright
  12. print $color->convert("%BHello World!%n\n");
  13. // To print a %, you use %%
  14. print $color->convert("3 out of 4 people make up about %r75%% %nof the " 
  15.                             ."world population.\n");
  16. // Or you can use the escape() method.
  17. print $color->convert("%y"
  18.      .$color->escape('If you feel that you do everying wrong, be random'
  19.                            .', there\'s a 50% Chance of making the right '
  20.                            .'decision.')."%n\n");

Documentation generated on Mon, 11 Mar 2019 15:51:04 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.