Sai-Mei
An elegant color naming system extending Sai with sophisticated color palettes
Sai-Mei (彩名) - combining Sai's color management with the on'yomi reading for 'name' - provides a comprehensive collection of named colors extending the Sai color management system. Drawing inspiration from traditional color vocabularies, Sai-Mei brings rich, curated color palettes to terminal interfaces.
Sai-Mei empowers developers to selectively incorporate sophisticated color collections into their CLI applications. Like its parent gem Sai, it combines precision with flexibility, allowing developers to organize and utilize color palettes with fine-grained control.
Installation
Add this line to your application's Gemfile:
gem 'sai-mei'
Or install it yourself as:
gem install sai-mei
Quick Start
require 'sai/mei'
# Install all colors from a palette
Sai::Mei.css.install
# Install specific colors
Sai::Mei.xterm
.only(:green, :dodger_blue_2, :spring_green_4)
.install
# Install colors with custom names
Sai::Mei.tailwind
.rename(blue_500: :primary, red_500: :danger)
.install
# Use the installed colors with Sai
Sai.primary.on_danger.decorate('Hello, World!')
Available Palettes
Sai-Mei includes several carefully curated color palettes:
- CSS - Web colors from CSS Color Module Level 4
- Tailwind - Color system from Tailwind CSS
- Xterm - Extended 256-color terminal palette
Each palette can be installed in its entirety or selectively customized to meet your needs. See individual palette documentation for complete color listings and usage examples.
Features
- 🎨 Multiple Color Palettes - Choose from standard ANSI, CSS web colors, Tailwind UI colors, or Xterm's extended palette
- 🔧 Selective Installation - Install entire palettes or pick specific colors
- 📝 Custom Naming - Rename colors to match your application's semantics
- 🔄 Chainable Configuration - Fluent interface for palette customization
- 🎯 Zero Runtime Overhead - Colors are registered once during setup
Documentation
Contributing
We welcome contributions! Please see our Contributing Guidelines for:
- Development setup and workflow
- Code style and documentation standards
- Testing requirements
- Pull request process
Before contributing, please review our Code of Conduct.
License
The gem is available as open source under the terms of the MIT License.