All Projects → metarhia → concolor

metarhia / concolor

Licence: MIT license
Colouring template strings using tags with annotations 🎨

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to concolor

leeks.js
Simple ANSI styling for your terminal
Stars: ✭ 12 (-65.71%)
Mutual labels:  console, color, colors, ansi
log-utils
Basic logging utils: colors, symbols and timestamp.
Stars: ✭ 24 (-31.43%)
Mutual labels:  console, color, colors, ansi
go-color
A lightweight, simple and cross-platform package to colorize text in terminals
Stars: ✭ 65 (+85.71%)
Mutual labels:  console, color, ansi
Chalk
🖍 Terminal string styling done right
Stars: ✭ 17,566 (+50088.57%)
Mutual labels:  console, color, ansi
Colorful
Terminal string styling done right, in Python 🐍 🎉
Stars: ✭ 456 (+1202.86%)
Mutual labels:  console, colors, ansi
console-logging
Better, prettier commandline logging for Python--with colors! 👻
Stars: ✭ 111 (+217.14%)
Mutual labels:  console, color, colors
Mordant
Full-featured text styling for Kotlin command-line applications
Stars: ✭ 382 (+991.43%)
Mutual labels:  console, color, ansi
strip-ansi-stream
Strip ANSI escape codes
Stars: ✭ 32 (-8.57%)
Mutual labels:  console, color, ansi
Colorette
Easily set the color and style of text in the terminal.
Stars: ✭ 1,047 (+2891.43%)
Mutual labels:  console, colors, ansi
yachalk
🖍️ Terminal string styling done right
Stars: ✭ 131 (+274.29%)
Mutual labels:  console, color, ansi
Termenv
Advanced ANSI style & color support for your terminal applications
Stars: ✭ 555 (+1485.71%)
Mutual labels:  console, colors, ansi
Console Logging
Better, prettier commandline logging for Python--with colors! 👻
Stars: ✭ 111 (+217.14%)
Mutual labels:  console, color, colors
Rang
A Minimal, Header only Modern c++ library for terminal goodies 💄✨
Stars: ✭ 1,080 (+2985.71%)
Mutual labels:  console, color, ansi
paper-terminal
Print Markdown to a paper in your terminal
Stars: ✭ 33 (-5.71%)
Mutual labels:  console, color, ansi
ansicolor
A JavaScript ANSI color/style management. ANSI parsing. ANSI to CSS. Small, clean, no dependencies.
Stars: ✭ 91 (+160%)
Mutual labels:  console, ansi
colored-console
🌈 Add some color to your console >_
Stars: ✭ 74 (+111.43%)
Mutual labels:  console, color
pytermgui
Python TUI framework with mouse support, modular widget system, customizable and rapid terminal markup language and more!
Stars: ✭ 1,270 (+3528.57%)
Mutual labels:  console, ansi
multi-brand-colors
Multi Brand Colors with support for CSS/CSS-Vars/SCSS/SASS/Stylus/LESS/JSON
Stars: ✭ 26 (-25.71%)
Mutual labels:  color, colors
common
Metarhia Common Library
Stars: ✭ 55 (+57.14%)
Mutual labels:  metarhia, impress
do
Simplest way to manage asynchronicity
Stars: ✭ 33 (-5.71%)
Mutual labels:  metarhia, impress

Concolor

ci status snyk npm version npm downloads/month npm downloads

Concolor is a simple library for Node.js for coloring templated strings using tags with annotations

Usage

String tag

console.log(concolor`text ${expression}(styles)`);

Examples:

console.log(concolor`Ave ${'World'}(blue) blue`);
console.log(concolor`Ave ${'World'}(/red) on red`);
console.log(concolor`Ave ${'World'}(white/yellow,b) bold white on yellow`);
console.log(concolor`Ave ${'World'}(b) bold`);
console.log(concolor`Ave ${'World'}(b,/blue) bold on blue`);
console.log(concolor`Ave ${'World'}(b,u,yellow) bold underline yellow`);
console.log(concolor`Ave ${'World'}(blue,u) blue underline`);
console.log(concolor`Ave ${'World'}(b,black/green) bold black on green`);

console.log(concolor`
  Client on ${'192.168.1.1'}(black/green)
  connected to ${'SERVER'}(b,red)
  at ${new Date().toUTCString()}(b,blue)
`);

Tag factory

const tag = concolor(styles);
console.log(tag`text`);

Examples:

const warn = concolor('b,yellow');
const err = concolor('b,yellow/red');
const inf = concolor('i,white');

console.log(warn`test1 ${'text2'} text3`);
console.log(err`test4 ${'text5'} text6`);
console.log(inf`test7 ${'text8'} text9`);

Style function

const style = concolor(styles);
console.log(style('text'));

Examples:

const warn = concolor('b,yellow');
const err = concolor('b,yellow/red');
const inf = concolor('i,white');

console.log(warn(`test1 ${'text2'} text3`));
console.log(err(`test4 ${'text5'} text6`));
console.log(inf(`test7 ${'text8'} text9`));

Themes

const theme = concolor({
  caption: 'b,white',
  text: 'green',
  link: 'u,yellow',
});

const caption = 'Caption';
const text = 'Here is a text';
const link = 'http://metarhia.com';

console.log(theme`  ${{ caption }}
  ${{ text }}
  ${{ link }}`);

Themes as functions

const theme = concolor({
  caption: 'b,white',
  text: 'green',
  link: 'u,yellow',
});

console.log(theme.caption('Caption example'));

License & Contributors

Copyright (c) 2017-2022 Metarhia contributors. Concolor is MIT licensed.
Concolor is a part of Metarhia technology stack.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].