rampa-colors
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRampa Color Palette Generator
Rampa 调色板生成器
Generate perceptually uniform color palettes from a base color using the OKLCH color space.
基于基础色,使用OKLCH色彩空间生成视觉感知一致的调色板。
Installation
安装
bash
undefinedbash
undefinedRun directly
直接运行
npx @basiclines/rampa -C "#3b82f6"
npx @basiclines/rampa -C "#3b82f6"
Or install globally
或全局安装
npm install -g @basiclines/rampa
undefinednpm install -g @basiclines/rampa
undefinedQuick Examples
快速示例
Generate a basic 10-color palette
生成基础10色调色板
bash
rampa -C "#3b82f6"bash
rampa -C "#3b82f6"Output as CSS variables
以CSS变量格式输出
bash
rampa -C "#3b82f6" -O css --name=primaryOutput:
css
:root {
--primary-0: #000000;
--primary-1: #1e3a5f;
--primary-2: #2d5a8a;
...
}bash
rampa -C "#3b82f6" -O css --name=primary输出:
css
:root {
--primary-0: #000000;
--primary-1: #1e3a5f;
--primary-2: #2d5a8a;
...
}Output as JSON
以JSON格式输出
bash
rampa -C "#3b82f6" -O jsonbash
rampa -C "#3b82f6" -O jsonAdd complementary harmony
添加互补色调和
bash
rampa -C "#3b82f6" --add=complementary -O cssbash
rampa -C "#3b82f6" --add=complementary -O cssCustom lightness and saturation ranges
自定义亮度与饱和度范围
bash
rampa -C "#3b82f6" -L 15:95 -S 100:20bash
rampa -C "#3b82f6" -L 15:95 -S 100:20Use Fibonacci distribution scale
使用斐波那契分布缩放
bash
rampa -C "#3b82f6" --lightness-scale=fibonaccibash
rampa -C "#3b82f6" --lightness-scale=fibonacciGenerate 5 colors with triadic harmony
生成5色三元调色板
bash
rampa -C "#3b82f6" --size=5 --add=triadic -O css --name=brandbash
rampa -C "#3b82f6" --size=5 --add=triadic -O css --name=brandAll Options
所有选项
| Flag | Alias | Description | Default |
|---|---|---|---|
| | Required. Base color (hex, rgb, hsl, or named) | - |
| - | Number of colors in palette | 10 |
| | Output format: | text |
| | Color format: | hex |
| - | Palette name (for CSS/JSON output) | base |
| | Lightness range (e.g., | 0:100 |
| | Saturation range (e.g., | 100:0 |
| | Hue shift range (e.g., | -10:10 |
| - | Distribution scale for lightness | linear |
| - | Distribution scale for saturation | linear |
| - | Distribution scale for hue | linear |
| - | Add harmony ramp | - |
| - | Tint overlay color | - |
| - | Tint opacity (0-100) | 10 |
| - | Tint blend mode | overlay |
| - | Hide color preview blocks | false |
| 标识 | 别名 | 描述 | 默认值 |
|---|---|---|---|
| | 必填项。 基础色(十六进制、rgb、hsl或命名色) | - |
| - | 调色板中的颜色数量 | 10 |
| | 输出格式: | text |
| | 颜色格式: | hex |
| - | 调色板名称(用于CSS/JSON输出) | base |
| | 亮度范围(例如: | 0:100 |
| | 饱和度范围(例如: | 100:0 |
| | 色相偏移范围(例如: | -10:10 |
| - | 亮度的分布缩放类型 | linear |
| - | 饱和度的分布缩放类型 | linear |
| - | 色相的分布缩放类型 | linear |
| - | 添加调和色阶 | - |
| - | 色调叠加颜色 | - |
| - | 色调叠加透明度(0-100) | 10 |
| - | 色调叠加混合模式 | overlay |
| - | 隐藏颜色预览块 | false |
Scale Types
缩放类型
Control how values are distributed across the palette:
- - Even spacing (default)
linear - - Fibonacci sequence
fibonacci - - Golden ratio progression
golden-ratio - - Slow start, fast end
ease-in - - Fast start, slow end
ease-out - - Slow start and end
ease-in-out - - Exponential growth
geometric - - Logarithmic curve
logarithmic
控制调色板中数值的分布方式:
- - 均匀分布(默认)
linear - - 斐波那契序列
fibonacci - - 黄金比例递进
golden-ratio - - 慢启动,快结束
ease-in - - 快启动,慢结束
ease-out - - 慢启动和结束
ease-in-out - - 指数增长
geometric - - 对数曲线
logarithmic
Harmony Types
色彩调和类型
Generate related color ramps:
- - Opposite on color wheel (+1 ramp)
complementary - - 3 colors, 120° apart (+2 ramps)
triadic - - Adjacent colors, 30° apart (+2 ramps)
analogous - - 2 colors near opposite (+2 ramps)
split-complementary - - 4 colors, 90° apart (+3 ramps)
square
生成相关的色彩色阶:
- - 补色(色轮上相对的颜色,+1组色阶)
complementary - - 三元色(3种颜色,间隔120°,+2组色阶)
triadic - - 邻近色(相邻颜色,间隔30°,+2组色阶)
analogous - - 分裂补色(补色附近的2种颜色,+2组色阶)
split-complementary - - 四方色(4种颜色,间隔90°,+3组色阶)
square
Blend Modes (for tinting)
混合模式(用于色调叠加)
normalmultiplyscreenoverlaydarkenlightencolor-dodgecolor-burnhard-lightsoft-lightnormalmultiplyscreenoverlaydarkenlightencolor-dodgecolor-burnhard-lightsoft-lightWhen to Use This Skill
何时使用该工具
- User asks to "generate a color palette"
- User needs "CSS color variables"
- User wants "accessible colors" or "design system colors"
- User mentions "color ramp" or "color scale"
- User needs "complementary/triadic/analogous colors"
- User wants "perceptually uniform" colors
- User is building a theme or design tokens
- 用户要求“生成调色板”
- 用户需要“CSS颜色变量”
- 用户想要“无障碍色彩”或“设计系统色彩”
- 用户提到“色彩色阶”或“色彩缩放”
- 用户需要“互补/三元/邻近色”
- 用户想要“视觉感知一致”的色彩
- 用户正在构建主题或设计令牌
Tips
小贴士
- For dark mode themes, use to avoid pure black/white
-L 5:85 - For muted palettes, use
-S 60:20 - Use for harmonious multi-color themes
--add=analogous - Use when you need to process colors programmatically
-O json - Combine with for minimal palettes
--size=5
- 对于深色模式主题,使用 避免纯黑/纯白
-L 5:85 - 对于低饱和度调色板,使用
-S 60:20 - 使用 创建和谐的多色主题
--add=analogous - 当需要以编程方式处理色彩时,使用
-O json - 结合 创建极简调色板
--size=5