COLORS
COLORS
Section: Misc. Reference Manual Pages (3) Updated: libbash colors Library Manual Local index
Up
BSD mandoc
NAME
colors
- libbash library for setting tty colors.
SYNOPSIS
- colorSet
-
Aq Ar color
- colorReset
-
- colorPrint
-
[Aq indent
]
Aq Ar color
Aq Ar text
- colorPrintN
-
[Aq indent
]
Aq Ar color
Aq Ar text
DESCRIPTION
General
is a collection of functions that make it very easy to put colored text on tty.
The function list:
- colorSet
-
Sets the color of the prints to the tty to COLOR
- colorReset
-
Resets current tty color back to normal
- colorPrint
-
Prints TEXT in the color COLOR indented by INDENT (without adding a newline)
- colorPrintN
-
The same as colorPrint, but trailing newline is added
Detailed interface description follows.
Available colors:
- Green
-
- Red
-
- Yellow
-
- White
-
The color parameter is non-case-sensitive (i.e. RED, red, ReD, and all the other forms are valid and are the
same as Red).
FUNCTIONS DESCRIPTIONS
colorSet Aq Fa color
Sets the current printing color to
color
colorReset
Resets current tty color back to normal.
colorPrint Bo Ao Fa indent Ac Bc Aq Fa color
Prints
text
using the color
color
indented by
indent
(without adding a newline).
Parameters:
- Aq Fa indent The column to move to before start printing.
-
This parameter is optional. If ommitted - start output from current cursor position.
- Aq Fa color The color to use.
-
- Aq Fa color The text to print.
-
colorPrintN Bo Ao Fa indent Ac Bc Aq Fa color The same as colorPrint, except a trailing newline is added.
EXAMPLES
Printing a green 'Hello World' with a newline:
- Using colorSet:
-
- Using colorPrint:
-
- Using colorPrintN:
-
AUTHORS
An Hai Zaar Aq haizaar@haizaar.com
An Gil Ran Aq gil@ran4.net
SEE ALSO
ldbash(1),
libbash(1)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- General
-
- Available colors:
-
- FUNCTIONS DESCRIPTIONS
-
- Cm colorSet Aq Ns Fa color Ns
-
- Cm colorReset
-
- Cm colorPrint Bo Ao Ns Fa indent Ns Ac Bc Aq Ns Fa color Ns
-
- Cm colorPrintN Bo Ao Ns Fa indent Ns Ac Bc Aq Ns Fa color Ns
-
- EXAMPLES
-
- AUTHORS
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 21:43:39 GMT, April 16, 2011