colors/README.md

43 lines
1.7 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# @d3v4pp/Colors.
[![GitHub license](https://img.shields.io/badge/licence-d3v4pp-red.svg)](https://cvs.d3v4pp.fr/D3V4PP/colors.git)
[![Discord](https://img.shields.io/discord/539267338193600532?label=Join&logo=discord)](https://discord.gg/kH9gXA)
[![npm version](https://img.shields.io/npm/v/@d3v4pp/colors?style=flat)](https://www.npmjs.com/package/@d3v4pp/colors)
Putting colors in terminal is an interesting idea bit,
what if the user dosent have a terminal that manage colors or have only 16 or 8 colors when you used a 256 colors logger or some other things ..
you will see text like this in your terminal
~~~
22m 1.83 KiB {0} [built]
~~~
##### This package will allow you to add colors to your terminal application with auto terminal detection and adaptation of colors
##### You will be able to use 255 colors code in Basics terminals
##### Coloration will have no effect on terminals that dosent manage colors
#### Try it its simple and easy to use
[![demo in terminal](http://statics.d3v4pp.fr/colors.png)](https://www.npmjs.com/package/@d3v4pp/colors)
## Installation
~~~
npm install @d3v4pp/colors --save
~~~
## How to use it
#### Using Colors instance methodes
~~~javascript
const Colors = require('@d3v4pp/colors');
console.log(Colors.color("text to log",[0..255]));
console.log(Colors.bgColor("text to log",[0..255]));
console.log(Colors.bgColor( Colors.color("text to log",[0..255]) , [0..255] ));
~~~
#### Using String.prototype
~~~javascript
const Colors = require('@d3v4pp/colors');
console.log("text to log".color([o..255]) );
console.log("text to log".bgColor([0..255]));
console.log("text to log".color([0..255]).bgColor([0..255])));
~~~