-
Notifications
You must be signed in to change notification settings - Fork 3
Color Themes
Vitaly Tomilov edited this page Oct 20, 2018
·
22 revisions
You can select either one of the predefined themes or create a custom theme.
Below is the list of all predefined themes, which can be selected by their name.
Example:
monitor.setTheme('bright');
NOTE: Images below look much better, if you click on them.
This is the default theme used by the library.
Unlike all other predefined themes, this one enforces white background.
In order to use a custom theme, simply call setTheme
, passing it an object with all the color properties, exactly as they are defined in file themes.js
Example
const color = require('cli-color'); // must use this color library;
const myTheme = {
time: color.bgWhite.black,
value: color.white,
cn: color.yellow,
tx: color.cyan,
paramTitle: color.magenta,
errorTitle: color.redBright,
query: color.whiteBright,
special: color.green,
error: color.red
};
monitor.setTheme(myTheme); // selecting your own theme;
P.S. Library cli-color was chosen as the one best handling background colors.