Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/azorng/material
A material design color palette for the terminal
https://github.com/azorng/material
binary cli color material-design rust terminal tui tui-rs
Last synced: about 1 month ago
JSON representation
A material design color palette for the terminal
- Host: GitHub
- URL: https://github.com/azorng/material
- Owner: azorng
- Created: 2022-08-09T20:18:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-18T09:10:15.000Z (11 months ago)
- Last Synced: 2024-10-31T11:44:39.281Z (about 2 months ago)
- Topics: binary, cli, color, material-design, rust, terminal, tui, tui-rs
- Language: Rust
- Homepage:
- Size: 31.3 KB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-ratatui - material - A material design color palette for the terminal. (💻 Apps / ⌨️ Development Tools)
README
# Material
A material design color palette for the terminal
## Installation
### Homebrew
```bash
brew tap azorng/material
brew install material
```### Cargo
First, install [Rust](https://www.rust-lang.org/tools/install) (using the recommended `rustup` installation method) and then
```bash
cargo install material --locked --features=cli
```## Usage
Run the command ``material`` in the terminal.
Type the color code to copy its hex color to the clipboard. Type Esc to exit.## As a library
This crate can also be used as a library in your own apps.
```bash
cargo add material
``````rust
use material_colors::colors;assert_eq!(colors::RED_50.to_string(), "#ffebee");
assert_eq!(colors::RED_100.to_string(), "#ffcdd2");
```### From Ratatui
Colors provided by the library can be converted to [Ratatui](https://ratatui.rs) colors. Just
enable the `ratatui` feature.```bash
cargo add material --features=ratatui
``````rust
use material_colors::colors;
use ratatui::prelude::*;let line = Line::styled("hello world", Style::new().fg(colors::RED_50.into()));
```