Add colors to your terminal!

unarray

Unarray

Posted on April 25, 2023

Add colors to your terminal!

Tintify is an NPM package that brings you all you need to add colors and effects to your terminal!

This package isn't a simple list of ANSI escape sequences.
It brings you utilities functions that permit you to use custom RGB colors or the HEXADECIMAL notations.
In future update, we will bring you others functions like new formatters. Current formatters permit you to transform your message into an rainbow text, a linear gradient between two colors, a matrix style text or a format function where you can pass flags to replace with a color (ie: flag §3 or §b will be transformed to a color or effect according to the config)


Installation

npm install tintify
Enter fullscreen mode Exit fullscreen mode

OR

pnpm install tintify
Enter fullscreen mode Exit fullscreen mode

Updates

Want to see new content? Open an issue!


Overview

Basic usage

Usage of constants

import { forground, brightBackground } from "tintify";

console.log(`${forground.blue}Hello ${forground.red}${brightBackground.blue}World!`);
Enter fullscreen mode Exit fullscreen mode

basic usage

Usage of functions

import { forgroundRGBColor, backgroundRGBColor, hexToRgb } from "tintify";

const helloFgColor = forgroundRGBColor({red: 63, green: 112, blue: 84});
const worldFgColor = forgroundRGBColor(hexToRgb("#9d19c2"));
const worldBgColor = backgroundRGBColor({red: 63, green: 112, blue: 84});

console.log(`${helloFgColor}Hello ${worldFgColor}${worldBgColor}World!`);
Enter fullscreen mode Exit fullscreen mode

RGB/Hex values

Formatters usage

Linear gradient effect

import { hexToRgb, linearGradient } from "tintify";

console.log(linearGradient("Tintify tints your untinted terminal", hexToRgb("#40db21"), {red: 255, green: 0, blue: 0}));
Enter fullscreen mode Exit fullscreen mode

linear gradient

Matrix effect

import { hexToRgb, matrix } from "tintify";

console.log(matrix("Tintify tints your untinted terminal", hexToRgb("#00FF00")));
console.log(matrix("Tintify tints your untinted terminal", hexToRgb("#00FF00"), 200));
Enter fullscreen mode Exit fullscreen mode

matrix

Rainbow effect

import { hexToRgb, rainbow } from "tintify";

console.log(rainbow("Tintify   tints   your   untinted   terminal"));
console.log(rainbow("Tintify   tints   your   untinted   terminal", hexToRgb("#00FF00")));
console.log(rainbow("Tintify   tints   your   untinted   terminal", hexToRgb("#00FF00"), 100));
console.log(rainbow("Tintify   tints   your   untinted   terminal", hexToRgb("#00FF00"), 100, false));
Enter fullscreen mode Exit fullscreen mode

rainbow

Format

import { defaultFormatConfig, forground, format } from "tintify";

console.log(format("§2Hello §b§4World!"));
console.log(format("§2Hello §b§4World!", {
  ...defaultFormatConfig,
  "§2": forground.blue
}));
Enter fullscreen mode Exit fullscreen mode

format

Links

💖 💪 🙅 🚩
unarray
Unarray

Posted on April 25, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Add colors to your terminal!
npm Add colors to your terminal!

April 25, 2023