Crates.io | material |
lib.rs | material |
version | 0.1.1 |
source | src |
created_at | 2022-08-09 20:23:00.066694 |
updated_at | 2024-01-18 09:10:11.236338 |
description | A material design color palette for the terminal |
homepage | |
repository | https://github.com/azorng/material |
max_upload_size | |
id | 641995 |
size | 64,523 |
A material design color palette for the terminal
brew tap azorng/material
brew install material
First, install Rust (using the recommended rustup
installation method) and then
cargo install material --locked --features=cli
Run the command material
in the terminal.
Type the color code to copy its hex color to the clipboard. Type Esc to exit.
This crate can also be used as a library in your own apps.
cargo add material
use material_colors::colors;
assert_eq!(colors::RED_50.to_string(), "#ffebee");
assert_eq!(colors::RED_100.to_string(), "#ffcdd2");
Colors provided by the library can be converted to Ratatui colors. Just
enable the ratatui
feature.
cargo add material --features=ratatui
use material_colors::colors;
use ratatui::prelude::*;
let line = Line::styled("hello world", Style::new().fg(colors::RED_50.into()));