colorStyle is a library of styles for command-line text write in Rust.

Overview

Colorstyle

crates.io Released API docs GPL3 licensed Downloads of Crates.io Lines of code Build Languages

colorStyle is a library of styles for command-line text.

Inspired by flylog/colorstyle (golang)

Example

  let text = colorstyle::green("green");
  println!("a {} text", text);

  let text = colorstyle::blue("Blue");
  println!("a {} text\n", text);

  let text = colorstyle::CSS::new().color_red().sprint("red");
  println!("a {} text",text);

  colorstyle::CSS::new().style_italic().color_red().bg_yellow().println("a italic red bgYellow text:  Hello 世界!");

  colorstyle::CSS::new().style_bold().println("a bold text: Hello 世界!");

  colorstyle::CSS::new().style_italic().println("a italic text: Hello 世界!");

  colorstyle::CSS::new().color_magenta().println("a magenta text: Hello 世界!");

  colorstyle::CSS::new().bg_cyan().println("a background color cyan text: Hello 世界!");

  colorstyle::CSS::new().bg_cyan().println("a background color cyan text");
  
  let mut css = colorstyle::CSS::new();
  css.style_strikethrough().println("删除线文本");

  css.style_underline().println("下划线文本");

  css.style_reverse().println("反显文本");

Doc

See this document at API documentation

Todo

  • 增加sprintf()宏支持可变数量的参数,参考标准的println!()

Screen

You might also like...
An implementation of Piet's text interface using cosmic-text

piet-cosmic-text Implements piet's Text interface using the cosmic-text crate. License piet-cosmic-text is free software: you can redistribute it and/

Command-line HTTP client for sending a POST request to specified URI on each stdin line.

line2httppost Simple tool to read lines from stdin and post each line as separate POST request to a specified URL (TCP connection is reused though). G

Pink is a command-line tool inspired by the Unix man command.

Pink is a command-line tool inspired by the Unix man command. It displays custom-formatted text pages in the terminal using a subset of HTML-like tags.

Pure Rust multi-line text handling
Pure Rust multi-line text handling

COSMIC Text Pure Rust multi-line text handling. COSMIC Text provides advanced text shaping, layout, and rendering wrapped up into a simple abstraction

Simple yet powerful multi-line text editor widget for tui-rs and ratatui
Simple yet powerful multi-line text editor widget for tui-rs and ratatui

tui-textarea tui-textarea is a simple yet powerful text editor widget like textarea in HTML for tui-rs and ratatui. Multi-line text editor can be ea

Library to write x64 Assembly code from Rust, more properly. Designed for the nasm assembler

x64asm Library to write x64 Assembly code from Rust, more properly. Designed for the nasm assembler How to use let mut f = Formatter::new(false); // f

A Rust program/library to write a Hello World message to the standard output.

hello-world Description hello-world is a Rust program and library that prints the line Hello, world! to the console. Why was this created? This progra

A command line progress reporting library for Rust
A command line progress reporting library for Rust

indicatif Documentation A Rust library for indicating progress in command line applications to users. This currently primarily provides progress bars

Low-level Rust library for implementing terminal command line interface, like in embedded systems.

Terminal CLI Need to build an interactive command prompt, with commands, properties and with full autocomplete? This is for you. Example, output only

omekasy is a command line application that converts alphanumeric characters in your input to various styles defined in Unicode.

omekasy is a command line application that converts alphanumeric characters in your input to various styles defined in Unicode. omekasy means "dress up" in Japanese.

null 105 Nov 16, 2022
Rust library for ANSI terminal colours and styles (bold, underline)

rust-ansi-term This is a library for controlling colours and formatting, such as red bold text or blue underlined text, on ANSI terminals. View the Ru

Benjamin Sago 407 Jan 2, 2023
A CLI utility installed as "ansi" to quickly get ANSI escape sequences. Supports the most basic ones, like colors and styles as bold or italic.

'ansi' - a CLI utility to quickly get ANSI escape codes This Rust project called ansi-escape-sequences-cli provides an executable called ansi which ca

Philipp Schuster 5 Jul 28, 2022
A simple solution for scoped styles in Leptos

Styled: Easy Styling for Leptos Components If you're looking for an easy way to apply scoped styles to your Leptos components, Styled is the Leptos ma

Eran Boodnero 8 Mar 5, 2023
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
Simple macros to write colored and formatted text to a terminal. Based on `termcolor`, thus also cross-platform.

Bunt: simple macro-based terminal colors and styles bunt offers macros to easily print colored and formatted text to a terminal. It is just a convenie

Lukas Kalbertodt 202 Dec 22, 2022
That program use on platform windows. And if you write any text on uncorrect keyboard layout, that program for that.

?? This program is designed to translate text into the correct layout when typing is incorrect. ?? Example ghbdtn -> привет Just (by default) pressing

Gest Se 5 Jan 26, 2023
A command-line utility which aligns a block of text within the terminal (or a specified number of columns), written in Rust.

align: a command line utility for aligning text. ⭐ Overview Aligns text within the terminal (or a specified number of columns). The text is treated as

Khalil Ouali 6 Aug 11, 2023
hj is a command line tool to convert HTTP/1-style text into JSON

hj hj is a command line tool to convert HTTP/1-style text into JSON. This command is inspired by yusukebe/rj, which is a standalone HTTP client that s

FUJI Goro 10 Aug 21, 2022
A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text!

uwuifyy A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text! Logo Credits: Jade Nelson Tab

Hamothy 43 Dec 12, 2022