Tiny color conversion library for TUI application builders

Related tags

Command-line coolor
Overview

MIT Latest Version docs Chat on Miaou

Definition of ANSI, RGB and HSL color types and all the conversions between them.

There are many other color conversion crates. This one may be useful when you're interested into

  • variations of an ANSI color for your TUI application, for example fading, lightening, darkening, with compatibility with terminals that don't support RGB.
  • translations of color schemes
  • automatic downgrading of RGB color schemes for non RGB terminals
  • automated building of harmonious color schemes with guarantees of contrast
  • etc.

Be warned that the ANSI range is limited and that not all intuitive operations will give good results.

Coolor doesn't contain functions to print on the terminal, but the colors can be used in other crates. There's an optional feature for conversion from and into Crossterm colors.

Included Examples

ansi-variations

Luminosity and saturation variations of all 240 ANSI colors, with all variants still ANSI colors.

ansi-variations

ansi-mix

Several ways to mix colors

ansi-mix

You might also like...
Core Fiberplane data models and methods for transforming them (templates, providers, markdown conversion)

fiberplane This repository is a monorepo for Rust code that is used throughout Fiberplane's product. Overview base64uuid - A utility for working with

Efficient scan conversion of a line segment with clipping to a rectangular window.
Efficient scan conversion of a line segment with clipping to a rectangular window.

✂️ clipline 📏 clipline is a Rust crate for efficient scan conversion of a line segment with clipping to a rectangular window. It is an implementation

SVG to PDF file conversion based on "svg2pdf" and "resvg" Rust projects

pysvg2pdf Blazingly Fast ™️ SVG to PDF file conversion for Python. This project is based on Rust's svg2pdf and resvg projects. The project uses pyo3 a

`ls` alternative with useful info and a splash of color 🎨
`ls` alternative with useful info and a splash of color 🎨

🎨 Natls 🎨 Why Natls? Showing file permissions Showing file size Showing the date that the file was modified last Showing the user that the file belo

Detects whether a terminal supports color, and gives details about that support

Detects whether a terminal supports color, and gives details about that support. It takes into account the NO_COLOR environment variable. This crate i

A command line tool for playing with color gradients
A command line tool for playing with color gradients

gradient A command-line tool for playing with color gradients. Features Lots of preset gradients. Custom gradient. Read gradients from SVG & GIMP grad

dye is a tool to easily color text in shell.
dye is a tool to easily color text in shell.

Dye dye is a tool to easily color text in shell. Usage See the gif below to see these commands in action. echo $(dye --red WARN) This tool will knock

Sanctity is an acronym for rust ansi16 color test utility
Sanctity is an acronym for rust ansi16 color test utility

sanctity 🌈 sanctity is an acronym for rust ansi16 color test utility. It prints your own text or the default text in all of the 16 terminal colors.

Adapt the screen's color spectrum according to the hour of the day in order to improve your sleep

circadianlight What It Is Circadian Light is a program, currently only working on Linux with X, that controls the color spectrum of your screen accord

Comments
  • Crossterm is at version 0.25.0 now

    Crossterm is at version 0.25.0 now

    Crossterm integration fails when using the latest version of crossterm (0.25.0 at time of writing). I'm hoping this is a simple Cargo.toml change... if not, maybe I can open a PR.

    opened by generic-user1 4
Owner
Canop
Denys Séguret - Freelance Rust programmer
Canop
A template for bootstrapping a Rust TUI application with tui-rs & crossterm

rust-tui-template A template for bootstrapping a Rust TUI application with tui-rs & crossterm. tui-rs The library is based on the principle of immedia

Orhun Parmaksız 72 Dec 31, 2022
Parse hex colors to tui::style::Color

Color -> Tui Parse hex colors to tui rgb colors #c3f111 -> Color::Rgb(195,241,17) Note that the indexed colors are NOT HEX #142 -> Color::Indexed(142)

Uttarayan Mondal 1 Nov 8, 2021
A tiny library and application for animating text in the terminal.

?? snailshell A tiny library and application for animating text in the terminal. ?? It's so easy to add some flair to your text RPGs or console progra

null 45 Mar 5, 2023
My resume (or yours) as a TUI application

Resume TUI This project is an attempt to make an interactive resume as a TUI application similar to efforts like This 2d animation portfolio. Installa

Robert Masen 3 Mar 21, 2024
A dead simple ANSI terminal color painting library for Rust.

yansi A dead simple ANSI terminal color painting library for Rust. use yansi::Paint; print!("{} light, {} light!", Paint::green("Green"), Paint::red(

Sergio Benitez 169 Dec 25, 2022
Rust library to convert RGB 24-bit colors into ANSI 256 (8-bit) color codes with zero dependencies and at compile-time.

rgb2ansi256 rgb2ansi256 is a small Rust library to convert RGB 24-bit colors into ANSI 256 (8-bit) color codes with zero dependencies and const fn. Th

Linda_pp 7 Nov 17, 2022
High-performance Javascript color gradient library powered by Rust + WebAssembly

colorgrad-js High-performance Javascript color gradient library powered by Rust + WebAssembly. No dependencies. Faster than d3-scale, chroma-js, culor

Nor Khasyatillah 168 Apr 25, 2023
Fast conversion between linear float and 8-bit sRGB

fast-srgb8 Small crate implementing fast conversion between linear float and 8-bit sRGB. Includes API for performing 4 simultaneous conversions, which

Thom Chiovoloni 13 Sep 3, 2022
Rust implementation of custom numeric base conversion.

base_custom Use any characters as your own numeric base and convert to and from decimal. This can be taken advantage of in various ways: Mathematics:

Daniel P. Clark 5 Dec 28, 2021
Fixed point to floating point (and back) conversion utility

fixed2float Simple utility for fixed point to real number conversions, using the VisSim (Fxm.b) and Q (Qm.n) notations. Usage as a dependency of your

Francesco Urbani 2 Aug 5, 2022