Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 1.04 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ┌─[tadzik@yavin4]─[~/src/nom] (nom)
  2. └─[%]─> cat foo.pl
  3. #= Color screen output using ANSI escape sequences
  4. module Term::ANSIColor;
  5.  
  6. #= emit ANSI sequence for the given string of attributes
  7. sub color (Str $what) is export { ... }
  8.  
  9. #= color the text according to the description
  10. sub colored (Str $what, Str $how) is export { ... }
  11.  
  12. #= is the color valid?
  13. sub colorvalid (*@a) is export { ... }
  14.  
  15. #= string colors from the string
  16. sub colorstrip (*@a) is export { ... }
  17.  
  18. #= transform ANSI sequences into their string descriptions
  19. sub uncolor (Str $what) is export { ... }
  20.  
  21. DOC INIT {
  22.     use Pod::To::Text;
  23.     print pod2text($=POD)
  24. }
  25. ┌─[tadzik@yavin4]─[~/src/nom] (nom)
  26. └─[%]─> ./perl6 --doc foo.pl
  27. sub color: emit ANSI sequence for the given string of attributes
  28. sub colored: color the text according to the description
  29. sub colorvalid: is the color valid?
  30. sub colorstrip: string colors from the string
  31. sub uncolor: transform ANSI sequences into their string descriptions
  32. module Term::ANSIColor: Color screen output using ANSI escape sequences