simple_colour-1.0.3 has been yanked.
simple_colour 🎨
simple_colour is a lightweight, zero-dependency Rust library that provides a convenient Trait-based approach to styling terminal output.
Features
Easy Integration:: Just import theColourtrait and use methods directly on&strorString.Chainable:Combine styles, foregrounds, and backgrounds easily.TrueColour Support:Access the full 24-bit colour range using RGB or 8-bit (256-colour) palettes.Specialty Effects:Includes a built-inrainbow()method for easy text effects.
Installation
Add this to your Cargo.toml:
[]
= "1.0.3"
Usage
use Colour;
Available Methods
Styles & Effects
| Method | Description |
|---|---|
.bold() |
Makes text bold |
.italic() |
Makes text italic |
.rainbow() |
Cycles through colours for each character |
Foreground Colours
- Standard:
.black(),.red(),.green(),.yellow(),.blue(),.magenta(),.cyan(),.white() - Bright:
.bright_black(),.bright_red(),.bright_green(),.bright_yellow(),.bright_blue(),.bright_magenta(),.bright_cyan(),.bright_white() - Special:
.orange(),.indigo(),.violet()
Background Colours
- Standard:
.bg_black(),.bg_red(),.bg_green(),.bg_yellow(),.bg_blue(),.bg_magenta(),.bg_cyan(),.bg_white() - Bright:
.bg_bright_black(),.bg_bright_red(),.bg_bright_green(),.bg_bright_yellow(),.bg_bright_blue(),.bg_bright_magenta(),.bg_bright_cyan(),.bg_bright_white()
Custom Palette (TrueColour)
.truecolour(u8)/.bg_truecolour(u8): Sets colour using 8-bit ANSI codes (0-255)..truecolour_rgb(r, g, b)/.bg_truecolour_rgb(r, g, b): Sets colour using 24-bit RGB values.
License
This project is licensed under the MIT License.