mateoox600 / MColor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:Apache License 2.0


Languages

Language:TypeScript 96.9%Language:JavaScript 3.1%