All Projects → iamsalnikov → colorize

iamsalnikov / colorize

Licence: MIT license
pub.dartlang.org/packages/colorize

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to colorize

laravel-make-me
Extendable Interactive Make Command for Laravel
Stars: ✭ 36 (+80%)
Mutual labels:  console
Inquirer.cs
A collection of common interactive command line user interfaces. Port of Inquirer.js
Stars: ✭ 26 (+30%)
Mutual labels:  console
log-utils
Basic logging utils: colors, symbols and timestamp.
Stars: ✭ 24 (+20%)
Mutual labels:  console
multitextor
Multiplatform command line text editor.
Stars: ✭ 27 (+35%)
Mutual labels:  console
congif
convert script(1) output to GIF
Stars: ✭ 52 (+160%)
Mutual labels:  console
oof
Convenient, high-performance RGB color and position control for console output
Stars: ✭ 764 (+3720%)
Mutual labels:  console
tvoip
Terminal-based P2P VoIP application (TeamSpeak-/Skype-like voice chatting over LAN or Internet)
Stars: ✭ 34 (+70%)
Mutual labels:  console
console
a debugger for async rust!
Stars: ✭ 2,101 (+10405%)
Mutual labels:  console
mini-me
Inline multiline text-editor/prompt written in Rust.
Stars: ✭ 23 (+15%)
Mutual labels:  console
x-terminal
An xterm based Atom plugin for providing terminals inside your Atom workspace.
Stars: ✭ 34 (+70%)
Mutual labels:  console
leeks.js
Simple ANSI styling for your terminal
Stars: ✭ 12 (-40%)
Mutual labels:  console
std
stdout, for humans.
Stars: ✭ 17 (-15%)
Mutual labels:  console
yachalk
🖍️ Terminal string styling done right
Stars: ✭ 131 (+555%)
Mutual labels:  console
go-color
A lightweight, simple and cross-platform package to colorize text in terminals
Stars: ✭ 65 (+225%)
Mutual labels:  console
px
ps and top for human beings
Stars: ✭ 151 (+655%)
Mutual labels:  console
Lua-Obfuscator
Obfuscate your lua code because it's so easy to steal!
Stars: ✭ 69 (+245%)
Mutual labels:  console
douban.fm
简洁的豆瓣电台命令行版。
Stars: ✭ 13 (-35%)
Mutual labels:  console
stylish-log
🎉 Stylish-log "A beautiful way to see your web console logs"
Stars: ✭ 12 (-40%)
Mutual labels:  console
laravel-console-spinner
Customized loading ⌛ spinner for Laravel Artisan Console.
Stars: ✭ 70 (+250%)
Mutual labels:  console
CLI-Autocomplete
Cross-platform flexible autocomplete library for your CLI applications.
Stars: ✭ 21 (+5%)
Mutual labels:  console

Colorize

Colorize console output in dart console apps!

Install

Add dependency to your pubspec.yaml:

colorize: any

Run

pub get

Usage

Import package:

import 'package:colorize/colorize.dart';

You have two way to colorize your string:

  • use class Colorize
  • use top-level function color()

Use Colorize

For colorize string with Colorize class you should create object of type Colorize:

Colorize string = new Colorize("This is my string!");

Then you can call methods of Colorize.

Text color

  • default()
  • black()
  • red()
  • green()
  • yellow()
  • blue()
  • magenta()
  • cyan()
  • lightGray()
  • darkGray()
  • lightRed()
  • lightGreen()
  • lightYellow()
  • lightBlue()
  • lightMagenta()
  • lightCyan()
  • white()

Background color

  • bgDefault()
  • bgBlack()
  • bgRed()
  • bgGreen()
  • bgYellow()
  • bgBlue()
  • bgMagenta()
  • bgCyan()
  • bgLightGray()
  • bgDarkGray()
  • bgLightRed()
  • bgLightGreen()
  • bgLightYellow()
  • bgLightBlue()
  • bgLightMagenta()
  • bgLightCyan()
  • bgWhite()

Formatting

  • reset()
  • bold()
  • dark()
  • italic()
  • underline()
  • blink()
  • reverse()
  • concealed()

After apply styles to string you can print it to console:

print(string);

Use top-level function color()

Top-level function color apply one required parameter - String text. It is text, that would be print on console.

Also top-level function color has seven named parameters:

  • Styles front - name of front color (you can also use the constants of class Styles). Default value is ''.
  • Styles back: name of background color (you can also use the constants of class Styles). Default value is ''.
  • bool isUnderline - default value is false.
  • bool isBold - default value is false.
  • bool isDark - default value is false.
  • bool isItalic - default value is false.
  • bool isReverse - default value is false.

Example of usage

color("Bold Italic Underline", front: Styles.RED, isBold: true, isItalic: true, isUnderline: true);

Enum Styles

Enum Styles contains all styles which you can pass to Colorize.applyState method;

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].