Npm package for console coloring.
- Full html color list
- Custom colors via Color class
- Text Styling (Bold, Italic, etc)
npm install @mateoox600/m-color
- Typescript is supported and types comes with the installation
const { mColor, HtmlColors, TextStyle, Color } = require('m-color');
console.log(mColor([ HtmlColors.Red.asFore(), TextStyle.Italic ], 'This text is red and in italic'));
console.log(mColor(new Color(0, 255, 0).asFore(), 'Text in blue'));
- Bold
- Dim
- Italic
- Underline
- For all text styles an inverse exist prefixed by
No
it can be used to remove style in a section of styled text without separating the text in two
A class to create colors, takes three args: red, green, blue. This class can be used to create foreground or background colors. The asBack() method returns the color for background. The asFore() method returns it for foreground.