NAME
Term::SimpleColor - A very simple color screen output
SYNOPSIS
use Term::SimpleColor;
print red "a red line\n";
print green;
print "green\n";
print "green line 2\n";
print default; # finish green
# backgroud color
use Term::SimpleColor qw(:background);
print bg_red "a line on red background\n";
print bg_green;
print "line 1 on green background\n";
print "line 2 on green background\n";
print bg_default; # finish green
# text decoration
use Term::SimpleColor qw(:decorate);
print underscore "a line with underscore\n";
print invert;
print "line 1 with invert\n";
print "line 2 with invert\n";
print dc_default; # finish invert
DESCRIPTION
Easy to make your terminal program output colorful.
Term::ANSIColor is very useful but complicate.
Term::SimpleColor provides easy understanding methods with an implementation optimised for the common case.
METHODS
- black( $string )
-
This shows black string. If parameter is set, only set the string black. The paramater is not set, you can show multiple string black. black method is defaultly exported. Exsample for one string print black( $string ); OR: print black $string; Exsample for multiple string. print black(); print $string1; print $string2; print default(); # back to default setting
- red( $string )
-
Same as black()
- green( $string )
-
Same as black()
- yellow( $string )
-
Same as black()
- blue( $string )
-
Same as black()
- magenta( $string )
-
Same as black()
- cyan( $string )
-
Same as black()
- white( $string )
-
Same as black()
- default()
-
Same as black()
- bg_black( $string )
-
This shows the string on black background. If parameter is set, only show the string on black backgrond. The paramater is not set, you can show multiple strings on black background. To export like these 'use Term::SimplrColor qw( bg_black );', 'use Term::SimplrColor qw( :background );' or 'use Term::SimplrColor qw( :all );' Exsample for using one string print bg_black( $string ); OR: print bg_black $string; Exsample for multiple string. print bg_black(); print $string1; print $string2; print bg_default(); # back to default setting
- bg_red( $string )
-
Same as bg_black()
- bg_green( $string )
-
Same as bg_black()
- bg_yellow( $string )
-
Same as bg_black()
- bg_blue( $string )
-
Same as bg_black()
- bg_magenta( $string )
-
Same as bg_black()
- bg_cyan( $string )
-
Same as bg_black()
- bg_gray( $string )
-
Same as bg_black()
- bg_default()
-
Same as bg_black()
- bold( $string )
-
This shows the bold string. If parameter is set, only show the bold string. The paramater is not set, you can show multiple bold strings. To export like these 'use Term::SimplrColor qw( bold );', 'use Term::SimplrColor qw( :decoration );' or 'use Term::SimplrColor qw( :all );' Exsample for using one string print bold( $string ); OR: print bold $string; Exsample for multiple string. print bold(); print $string1; print $string2; print dc_default(); # back to default setting
- underscore( $string )
-
Same as bold().
- invert( $string )
-
Same as bold().
- dc_default()
-
Same as bold().
AUTHOR
Takashi Uesugi <tksuesg@gmail.com>
COPYRIGHT AND LICENCE
Copyright (C) 2013 by Takashi Uesugi This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.