@basiclines/rampa 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +257 -0
  2. package/dist/index.js +10459 -0
  3. package/package.json +51 -0
package/README.md ADDED
@@ -0,0 +1,257 @@
1
+ # Rampa CLI
2
+
3
+ Generate mathematically accurate, accessible color palettes from a base color.
4
+
5
+ ## Installation
6
+
7
+ ### Homebrew (macOS/Linux)
8
+
9
+ ```bash
10
+ brew tap basiclines/tap
11
+ brew install rampa
12
+ ```
13
+
14
+ ### Download Binary
15
+
16
+ Download the latest binary for your platform from the [releases page](https://github.com/basiclines/rampa-studio/releases).
17
+
18
+ | Platform | Architecture | File |
19
+ |----------|--------------|------|
20
+ | macOS | Apple Silicon | `rampa-darwin-arm64` |
21
+ | macOS | Intel | `rampa-darwin-x64` |
22
+ | Linux | x64 | `rampa-linux-x64` |
23
+ | Linux | ARM64 | `rampa-linux-arm64` |
24
+ | Windows | x64 | `rampa-windows-x64.exe` |
25
+
26
+ ### From Source
27
+
28
+ ```bash
29
+ cd cli
30
+ bun install
31
+ bun run build
32
+ # Binary: ./dist/rampa
33
+ ```
34
+
35
+ ## Quick Start
36
+
37
+ ```bash
38
+ # Generate a 10-color palette from blue
39
+ rampa --color="#3b82f6"
40
+
41
+ # Custom size with lightness range
42
+ rampa -C "#3b82f6" --size=5 -L 10:90
43
+
44
+ # Add complementary harmony
45
+ rampa -C "#3b82f6" --add=complementary
46
+
47
+ # Output as CSS variables
48
+ rampa -C "#3b82f6" --output=css
49
+ ```
50
+
51
+ ## Usage
52
+
53
+ ```
54
+ rampa --color <color> [options]
55
+ ```
56
+
57
+ ## Flags
58
+
59
+ ### Required
60
+
61
+ | Flag | Alias | Description |
62
+ |------|-------|-------------|
63
+ | `--color` | `-C` | Base color (hex, hsl, rgb, oklch) |
64
+
65
+ ### Color Format
66
+
67
+ | Flag | Alias | Description | Default |
68
+ |------|-------|-------------|---------|
69
+ | `--format` | `-F` | Output format: hex, hsl, rgb, oklch | Same as input |
70
+
71
+ ### Palette Size
72
+
73
+ | Flag | Description | Default |
74
+ |------|-------------|---------|
75
+ | `--size` | Number of colors (2-100) | 10 |
76
+
77
+ ### Color Ranges
78
+
79
+ | Flag | Alias | Description | Default |
80
+ |------|-------|-------------|---------|
81
+ | `--lightness` | `-L` | Lightness range start:end (0-100) | 0:100 |
82
+ | `--saturation` | `-S` | Saturation range start:end (0-100) | 100:0 |
83
+ | `--hue` | `-H` | Hue shift range start:end (degrees) | -10:10 |
84
+
85
+ ### Scale Types
86
+
87
+ | Flag | Description | Default |
88
+ |------|-------------|---------|
89
+ | `--lightness-scale` | Lightness distribution curve | linear |
90
+ | `--saturation-scale` | Saturation distribution curve | linear |
91
+ | `--hue-scale` | Hue distribution curve | linear |
92
+
93
+ Available scales: `linear`, `geometric`, `fibonacci`, `golden-ratio`, `logarithmic`, `powers-of-2`, `musical-ratio`, `cielab-uniform`, `ease-in`, `ease-out`, `ease-in-out`
94
+
95
+ ### Tinting
96
+
97
+ | Flag | Description | Default |
98
+ |------|-------------|---------|
99
+ | `--tint-color` | Tint color to blend over palette | - |
100
+ | `--tint-opacity` | Tint strength 0-100 | 0 |
101
+ | `--tint-blend` | Blend mode for tinting | normal |
102
+
103
+ Available blend modes: `normal`, `multiply`, `screen`, `overlay`, `darken`, `lighten`, `color-dodge`, `color-burn`, `hard-light`, `soft-light`, `difference`, `exclusion`, `hue`, `saturation`, `color`, `luminosity`
104
+
105
+ ### Harmony Ramps
106
+
107
+ | Flag | Description |
108
+ |------|-------------|
109
+ | `--add` | Add harmony ramp (repeatable) |
110
+
111
+ Available harmonies: `complementary`, `triadic`, `analogous`, `split-complementary`, `square`, `compound`
112
+
113
+ ### Output
114
+
115
+ | Flag | Alias | Description | Default |
116
+ |------|-------|-------------|---------|
117
+ | `--output` | `-O` | Output format: text, json, css | text |
118
+ | `--preview` | | Show colored squares | true |
119
+
120
+ ### Other
121
+
122
+ | Flag | Alias | Description |
123
+ |------|-------|-------------|
124
+ | `--help` | `-h` | Show help |
125
+ | `--version` | `-v` | Show version |
126
+
127
+ ## Examples
128
+
129
+ ### Basic Palette
130
+
131
+ ```bash
132
+ rampa -C "#3b82f6"
133
+ ```
134
+
135
+ ### Custom Lightness Range
136
+
137
+ ```bash
138
+ rampa -C "#3b82f6" -L 10:90 --lightness-scale=fibonacci
139
+ ```
140
+
141
+ ### With Tinting
142
+
143
+ ```bash
144
+ rampa -C "#3b82f6" --tint-color="#FF0000" --tint-opacity=15 --tint-blend=overlay
145
+ ```
146
+
147
+ ### Multiple Harmonies
148
+
149
+ ```bash
150
+ rampa -C "#3b82f6" --add=complementary --add=triadic
151
+ ```
152
+
153
+ ### JSON Output
154
+
155
+ ```bash
156
+ rampa -C "#3b82f6" --size=5 --output=json
157
+ ```
158
+
159
+ Output:
160
+ ```json
161
+ {
162
+ "ramps": [
163
+ {
164
+ "name": "base",
165
+ "baseColor": "#3b82f6",
166
+ "config": { ... },
167
+ "colors": ["#000000", "#103c70", "#4070bf", "#afb9cf", "#ffffff"]
168
+ }
169
+ ]
170
+ }
171
+ ```
172
+
173
+ ### CSS Custom Properties
174
+
175
+ ```bash
176
+ rampa -C "#3b82f6" --size=5 --output=css
177
+ ```
178
+
179
+ Output:
180
+ ```css
181
+ :root {
182
+ /* base */
183
+ --base-0: #000000;
184
+ --base-25: #103c70;
185
+ --base-50: #4070bf;
186
+ --base-75: #afb9cf;
187
+ --base-100: #ffffff;
188
+ }
189
+ ```
190
+
191
+ ### CSS with Harmonies
192
+
193
+ ```bash
194
+ rampa -C "#3b82f6" -O css --add=complementary
195
+ ```
196
+
197
+ Output:
198
+ ```css
199
+ :root {
200
+ /* base */
201
+ --base-0: #000000;
202
+ --base-50: #4070bf;
203
+ --base-100: #ffffff;
204
+
205
+ /* complementary */
206
+ --complementary-0: #000000;
207
+ --complementary-50: #bf8f40;
208
+ --complementary-100: #ffffff;
209
+ }
210
+ ```
211
+
212
+ ### Piping (no preview)
213
+
214
+ ```bash
215
+ rampa -C "#3b82f6" --no-preview | head -5
216
+ ```
217
+
218
+ ## Contextual Help
219
+
220
+ Run any flag without a value to see detailed help:
221
+
222
+ ```bash
223
+ rampa --lightness-scale
224
+ rampa --add
225
+ rampa --output
226
+ ```
227
+
228
+ ## Development
229
+
230
+ ```bash
231
+ cd cli
232
+ bun install
233
+
234
+ # Run in development
235
+ bun run dev -- -C "#3b82f6"
236
+
237
+ # Run tests
238
+ bun test
239
+
240
+ # Build for current platform
241
+ bun run build
242
+
243
+ # Build for all platforms
244
+ bun run build:all
245
+ ```
246
+
247
+ ## Build Targets
248
+
249
+ ```bash
250
+ bun run build # Current platform
251
+ bun run build:darwin-arm64 # macOS Apple Silicon
252
+ bun run build:darwin-x64 # macOS Intel
253
+ bun run build:linux-x64 # Linux x64
254
+ bun run build:linux-arm64 # Linux ARM64
255
+ bun run build:windows-x64 # Windows x64
256
+ bun run build:all # All platforms
257
+ ```