Skip to content

mateoox600/MColor

Repository files navigation

MColor

Npm package for console coloring.


Features

  • Full html color list
  • Custom colors via Color class
  • Text Styling (Bold, Italic, etc)

Installation

npm install @mateoox600/m-color
  • Typescript is supported and types comes with the installation

Usage

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'));

Docs

HtmlColors

TextStyles

  • 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

Color

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published