bracket-color

This crate provides a color system for use in the bracket-terminal system. It is part of the overall bracket-lib system.

Using bracket-color

To obtain bracket-color, include the following in your Cargo.toml file:

toml [dependencies] bracket-color = "~0.8"

RGB

The basic structure is RGB, which represents a color as red/green/blue components. You can construct a color in a number of ways:

You can also convert RGB structures:

HSV

The HSV system provides color support in the HSV space. You can construct an HSV color as follows:

You can also go back to RGB with to_rgb.

ColorPair

A ColorPair is simply a helper structure holding both a foreground and a background.

Exports

Everything is exported via the bracket_color::prelude namespace.

Feature Flags

Examples

There are a few examples to help get you going. They use crossterm for terminal output. You may run the examples with cargo run --example <name>.