@basiclines/rampa 1.4.0 → 1.5.2

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 +76 -0
  2. package/dist/index.js +9748 -8073
  3. package/package.json +5 -1
package/README.md CHANGED
@@ -169,6 +169,62 @@ The `-A` flag generates an accessibility report using the [APCA](https://github.
169
169
  | `minimum` | 30 | Minimum text |
170
170
  | `nontext` | 15 | Non-text elements |
171
171
 
172
+ ### Color Spaces
173
+
174
+ | Flag | Description |
175
+ |------|-------------|
176
+ | `colorspace` | Subcommand for querying color spaces |
177
+
178
+ The `colorspace` subcommand lets you define and query multi-dimensional color spaces directly from the CLI.
179
+
180
+ #### Inline Mode
181
+
182
+ ```bash
183
+ # Linear: 2-color interpolated ramp
184
+ rampa colorspace --linear '#ffffff' '#000000' --size 24 --at 12
185
+
186
+ # Cube: 8-corner color cube with named aliases
187
+ rampa colorspace --cube k=#1e1e2e r=#f38ba8 g=#a6e3a1 b=#89b4fa \
188
+ y=#f9e2af m=#cba6f7 c=#94e2d5 w=#cdd6f4 \
189
+ --size 6 --tint r:4,b:2
190
+
191
+ # Lookup table (no interpolation)
192
+ rampa colorspace --linear '#f00' '#0f0' '#00f' --interpolation false --at 2
193
+ ```
194
+
195
+ #### Config File Mode
196
+
197
+ ```bash
198
+ # Define once in a JSON file, query repeatedly
199
+ rampa colorspace --config catppuccin.json --tint r:4,b:2
200
+ rampa colorspace --config catppuccin.json --tint w:3 --format hsl
201
+ ```
202
+
203
+ Config file format:
204
+ ```json
205
+ {
206
+ "type": "cube",
207
+ "corners": { "k": "#1e1e2e", "r": "#f38ba8", "g": "#a6e3a1", "b": "#89b4fa",
208
+ "y": "#f9e2af", "m": "#cba6f7", "c": "#94e2d5", "w": "#cdd6f4" },
209
+ "size": 6,
210
+ "interpolation": "oklch"
211
+ }
212
+ ```
213
+
214
+ #### Colorspace Flags
215
+
216
+ | Flag | Description | Default |
217
+ |------|-------------|---------|
218
+ | `--linear` | Define a linear color space (2+ colors) | - |
219
+ | `--cube` | Define a cube color space (8 key=color pairs) | - |
220
+ | `--config` | Load color space from a JSON config file | - |
221
+ | `--size` | Resolution per axis | 6 |
222
+ | `--at` | Query a specific 1-based index (linear) | - |
223
+ | `--tint` | Query cube with alias:intensity pairs (e.g., `r:4,b:2`) | - |
224
+ | `--interpolation` | Interpolation mode: oklch, lab, rgb, false | oklch |
225
+ | `--format` | Output format: hex, hsl, rgb, oklch | hex |
226
+ | `--output` | Output mode: text, json | text |
227
+
172
228
  ### Other
173
229
 
174
230
  | Flag | Alias | Description |
@@ -302,6 +358,26 @@ rampa -C "#3b82f6" --add=complementary -A -O json
302
358
  rampa -C "#3b82f6" --add=complementary -A -O css
303
359
  ```
304
360
 
361
+ ### Color Spaces
362
+
363
+ ```bash
364
+ # Interpolated grayscale ramp, query the midpoint
365
+ rampa colorspace --linear '#ffffff' '#000000' --size 24 --at 12
366
+
367
+ # 8-corner color cube, query a tint
368
+ rampa colorspace --cube k=#1e1e2e r=#f38ba8 g=#a6e3a1 b=#89b4fa \
369
+ y=#f9e2af m=#cba6f7 c=#94e2d5 w=#cdd6f4 \
370
+ --size 6 --tint r:4,b:2
371
+
372
+ # Full palette as JSON
373
+ rampa colorspace --cube k=#000 r=#f00 g=#0f0 b=#00f \
374
+ y=#ff0 m=#f0f c=#0ff w=#fff \
375
+ --size 6 --output json
376
+
377
+ # Config file for repeated queries
378
+ rampa colorspace --config theme.json --tint r:4,b:2 --format hsl
379
+ ```
380
+
305
381
  ## Contextual Help
306
382
 
307
383
  Run any flag without a value to see detailed help: