Palette — Color Palette Generation & Management Tool
Generate harmonious color palettes using color theory (complementary, analogous, triadic), create random palettes, preview colors in terminal, export to CSS/JSON/SVG, and manage a library of saved palettes. Essential for designers, frontend developers, and anyone working with color systems.
Prerequisites
- - Python 3.8+
- INLINECODE0 shell
- Terminal with ANSI color support (for previews)
Data Storage
All palette data is stored in ~/.palette/data.jsonl as newline-delimited JSON. Each record contains palette name, colors (hex values), color theory type, and metadata.
Configuration is stored in ~/.palette/config.json.
Commands
create
Create a new named palette from a list of hex color values.
CODEBLOCK0
random
Generate a random palette with a specified number of colors (default: 5). Optionally constrain by hue range or saturation.
CODEBLOCK1
complementary
Generate a complementary color palette from a base color. Returns the base color and its complement with optional shades.
CODEBLOCK2
analogous
Generate an analogous color palette from a base color. Returns colors adjacent on the color wheel (±30°).
CODEBLOCK3
triadic
Generate a triadic color palette from a base color. Returns three colors equally spaced (120°) on the color wheel.
CODEBLOCK4
export
Export a palette to various formats: CSS custom properties, JSON, SVG swatches, Tailwind config, or SCSS variables.
CODEBLOCK5
preview
Display a palette in the terminal using ANSI color blocks. Shows hex values, RGB, and HSL alongside color swatches.
CODEBLOCK6
list
List all saved palettes with their names, color counts, and creation dates.
CODEBLOCK7
save
Save/bookmark the most recently generated palette with a name and optional tags for organization.
CODEBLOCK8
config
View or update configuration (default color count, preferred format, terminal color mode).
CODEBLOCK9
help
Show usage information and available commands.
CODEBLOCK10
version
Display the current version of the palette skill.
CODEBLOCK11
Examples
CODEBLOCK12
Color Theory Quick Reference
- - Complementary: Opposite on the color wheel (high contrast)
- Analogous: Adjacent colors (harmonious, low contrast)
- Triadic: Three equidistant colors (vibrant, balanced)
- Random: Algorithmically generated with optional constraints
Notes
- - Colors are stored and processed as hex values internally, converted to RGB/HSL as needed.
- Terminal preview requires a terminal that supports 24-bit (truecolor) ANSI codes.
- Export formats include CSS, JSON, SVG, SCSS, and Tailwind — easily extensible.
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
调色板 — 色彩方案生成与管理工具
运用色彩理论(互补色、类似色、三色系)生成和谐色彩方案,创建随机调色板,在终端中预览颜色,导出为CSS/JSON/SVG格式,并管理已保存的调色板库。适用于设计师、前端开发人员及所有从事色彩系统相关工作的人员。
前置条件
- - Python 3.8+
- bash shell
- 支持ANSI颜色的终端(用于预览)
数据存储
所有调色板数据以换行分隔的JSON格式存储在~/.palette/data.jsonl中。每条记录包含调色板名称、颜色(十六进制值)、色彩理论类型和元数据。
配置文件存储在~/.palette/config.json中。
命令
create
从十六进制颜色值列表创建新的命名调色板。
PALETTENAME=ocean-breeze PALETTECOLORS=#0077B6,#00B4D8,#90E0EF,#CAF0F8,#023E8A bash scripts/script.sh create
random
生成包含指定数量颜色的随机调色板(默认:5)。可选择按色相范围或饱和度进行约束。
PALETTECOUNT=5 PALETTEHUEMIN=180 PALETTEHUE_MAX=270 bash scripts/script.sh random
complementary
从基础颜色生成互补色配色方案。返回基础颜色及其补色,可选包含渐变色阶。
PALETTEBASE=#FF6B35 PALETTESHADES=3 bash scripts/script.sh complementary
analogous
从基础颜色生成类似色配色方案。返回色轮上相邻的颜色(±30°)。
PALETTEBASE=#2EC4B6 PALETTECOUNT=5 bash scripts/script.sh analogous
triadic
从基础颜色生成三色系配色方案。返回色轮上等距分布(120°)的三种颜色。
PALETTEBASE=#E71D36 PALETTESHADES=2 bash scripts/script.sh triadic
export
将调色板导出为多种格式:CSS自定义属性、JSON、SVG色板、Tailwind配置或SCSS变量。
PALETTEID= PALETTEFORMAT=css PALETTE_OUTPUT=./colors.css bash scripts/script.sh export
preview
使用ANSI颜色块在终端中显示调色板。在色板旁显示十六进制值、RGB和HSL值。
PALETTE_ID= bash scripts/script.sh preview
list
列出所有已保存的调色板及其名称、颜色数量和创建日期。
bash scripts/script.sh list
save
保存/收藏最近生成的调色板,可添加名称和可选标签以便组织管理。
PALETTENAME=sunset-vibes PALETTETAGS=warm,sunset,gradient bash scripts/script.sh save
config
查看或更新配置(默认颜色数量、首选格式、终端颜色模式)。
PALETTEKEY=defaultcount PALETTE_VALUE=7 bash scripts/script.sh config
help
显示使用信息和可用命令。
bash scripts/script.sh help
version
显示调色板技能的当前版本。
bash scripts/script.sh version
示例
bash
从品牌颜色生成三色系配色方案
PALETTE_BASE=#6C63FF bash scripts/script.sh triadic
保存并命名
PALETTE_NAME=brand-triadic bash scripts/script.sh save
在终端中预览
PALETTE_ID=
bash scripts/script.sh preview
导出为CSS自定义属性
PALETTEID= PALETTEFORMAT=css PALETTE_OUTPUT=./brand-colors.css bash scripts/script.sh export
色彩理论快速参考
- - 互补色:色轮上相对的颜色(高对比度)
- 类似色:相邻的颜色(和谐,低对比度)
- 三色系:三种等距分布的颜色(生动,平衡)
- 随机:通过算法生成,可添加可选约束条件
注意事项
- - 颜色在内部以十六进制值存储和处理,根据需要转换为RGB/HSL。
- 终端预览需要支持24位(真彩色)ANSI代码的终端。
- 导出格式包括CSS、JSON、SVG、SCSS和Tailwind——易于扩展。
由BytesAgain提供 | bytesagain.com | hello@bytesagain.com