@basiclines/rampa 1.1.1 → 1.2.0
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.
- package/README.md +10 -0
- package/dist/index.js +26 -14
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -280,6 +280,16 @@ bun run build
|
|
|
280
280
|
bun run build:all
|
|
281
281
|
```
|
|
282
282
|
|
|
283
|
+
## AI Evals
|
|
284
|
+
|
|
285
|
+
Compare how different LLM models use the Rampa CLI by sending the same prompt to multiple models in agent mode. Models can discover rampa via `--help`, execute commands, and iterate. Use `--raw` to run without rampa for baseline comparison. See [evals/README.md](evals/README.md) for details.
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
bun run eval # all prompts, all models
|
|
289
|
+
bun run eval --prompt ghostty-matrix-theme --no-judge # single prompt
|
|
290
|
+
bun run eval --prompt ghostty-matrix-theme --raw # without rampa (baseline)
|
|
291
|
+
```
|
|
292
|
+
|
|
283
293
|
## Build Targets
|
|
284
294
|
|
|
285
295
|
```bash
|
package/dist/index.js
CHANGED
|
@@ -9518,8 +9518,8 @@ var calculateHue = (config, position, baseHue, middleIndex, i2) => {
|
|
|
9518
9518
|
};
|
|
9519
9519
|
var calculateSaturation = (config, position, baseSaturation, middleIndex, i2) => {
|
|
9520
9520
|
try {
|
|
9521
|
-
const startSaturation = config.saturationStart / 100;
|
|
9522
|
-
const endSaturation = config.saturationEnd / 100;
|
|
9521
|
+
const startSaturation = config.saturationStart / 100 * baseSaturation;
|
|
9522
|
+
const endSaturation = config.saturationEnd / 100 * baseSaturation;
|
|
9523
9523
|
const newSaturation = startSaturation + (endSaturation - startSaturation) * position;
|
|
9524
9524
|
return clampValue2(newSaturation, 0, 1);
|
|
9525
9525
|
} catch (error) {
|
|
@@ -9898,8 +9898,19 @@ function formatCss2(ramps) {
|
|
|
9898
9898
|
}
|
|
9899
9899
|
|
|
9900
9900
|
// src/utils/terminal-colors.ts
|
|
9901
|
+
function supportsTruecolor() {
|
|
9902
|
+
const colorterm = process.env.COLORTERM?.toLowerCase() || "";
|
|
9903
|
+
if (colorterm === "truecolor" || colorterm === "24bit") {
|
|
9904
|
+
return true;
|
|
9905
|
+
}
|
|
9906
|
+
const term = process.env.TERM?.toLowerCase() || "";
|
|
9907
|
+
if (term.includes("truecolor") || term.includes("24bit") || term.includes("direct")) {
|
|
9908
|
+
return true;
|
|
9909
|
+
}
|
|
9910
|
+
return false;
|
|
9911
|
+
}
|
|
9901
9912
|
function hasLimitedColorSupport() {
|
|
9902
|
-
return
|
|
9913
|
+
return !supportsTruecolor();
|
|
9903
9914
|
}
|
|
9904
9915
|
function rgbTo256(r4, g3, b2) {
|
|
9905
9916
|
if (r4 === g3 && g3 === b2) {
|
|
@@ -9926,8 +9937,8 @@ function getColorLimitationNote() {
|
|
|
9926
9937
|
const dim = "\x1B[2m";
|
|
9927
9938
|
const yellow = "\x1B[33m";
|
|
9928
9939
|
const reset = "\x1B[0m";
|
|
9929
|
-
return `${yellow}Note:${reset} ${dim}Using 256-color mode.
|
|
9930
|
-
${dim}For accurate color previews, use
|
|
9940
|
+
return `${yellow}Note:${reset} ${dim}Using 256-color mode. Terminal does not advertise truecolor support.${reset}
|
|
9941
|
+
${dim}For accurate color previews, use a terminal with COLORTERM=truecolor.${reset}`;
|
|
9931
9942
|
}
|
|
9932
9943
|
return null;
|
|
9933
9944
|
}
|
|
@@ -9941,7 +9952,7 @@ function showHelp() {
|
|
|
9941
9952
|
const dim = "\x1B[2m";
|
|
9942
9953
|
const reset = "\x1B[0m";
|
|
9943
9954
|
const help = `
|
|
9944
|
-
rampa v1.
|
|
9955
|
+
rampa v1.2.0
|
|
9945
9956
|
Generate mathematically accurate color palettes from a base color
|
|
9946
9957
|
|
|
9947
9958
|
USAGE
|
|
@@ -10179,13 +10190,13 @@ var validFormats = ["hex", "hsl", "rgb", "oklch"];
|
|
|
10179
10190
|
var main = defineCommand({
|
|
10180
10191
|
meta: {
|
|
10181
10192
|
name: "rampa",
|
|
10182
|
-
version: "1.
|
|
10193
|
+
version: "1.2.0",
|
|
10183
10194
|
description: "Generate mathematically accurate color palettes from a base color"
|
|
10184
10195
|
},
|
|
10185
10196
|
args: {
|
|
10186
10197
|
color: {
|
|
10187
10198
|
type: "string",
|
|
10188
|
-
alias: "C",
|
|
10199
|
+
alias: ["C", "c"],
|
|
10189
10200
|
description: "Base color (hex, hsl, rgb, oklch)",
|
|
10190
10201
|
required: true
|
|
10191
10202
|
},
|
|
@@ -10196,18 +10207,18 @@ var main = defineCommand({
|
|
|
10196
10207
|
},
|
|
10197
10208
|
format: {
|
|
10198
10209
|
type: "string",
|
|
10199
|
-
alias: "F",
|
|
10210
|
+
alias: ["F", "f"],
|
|
10200
10211
|
description: "Output format: hex, hsl, rgb, oklch (default: same as input)"
|
|
10201
10212
|
},
|
|
10202
10213
|
lightness: {
|
|
10203
10214
|
type: "string",
|
|
10204
|
-
alias: "L",
|
|
10215
|
+
alias: ["L", "l"],
|
|
10205
10216
|
description: "Lightness range start:end (0-100, default: 0:100)",
|
|
10206
10217
|
default: "0:100"
|
|
10207
10218
|
},
|
|
10208
10219
|
saturation: {
|
|
10209
10220
|
type: "string",
|
|
10210
|
-
alias: "S",
|
|
10221
|
+
alias: ["S", "s"],
|
|
10211
10222
|
description: "Saturation range start:end (0-100, default: 100:0)",
|
|
10212
10223
|
default: "100:0"
|
|
10213
10224
|
},
|
|
@@ -10257,7 +10268,7 @@ var main = defineCommand({
|
|
|
10257
10268
|
},
|
|
10258
10269
|
output: {
|
|
10259
10270
|
type: "string",
|
|
10260
|
-
alias: "O",
|
|
10271
|
+
alias: ["O", "o"],
|
|
10261
10272
|
description: "Output format: text, json, css (default: text)",
|
|
10262
10273
|
default: "text"
|
|
10263
10274
|
}
|
|
@@ -10504,7 +10515,8 @@ var main = defineCommand({
|
|
|
10504
10515
|
} else if (outputType === "css") {
|
|
10505
10516
|
console.log(formatCss2(ramps));
|
|
10506
10517
|
} else {
|
|
10507
|
-
|
|
10518
|
+
const canShowPreview = args.preview && supportsTruecolor();
|
|
10519
|
+
if (args.preview && !canShowPreview) {
|
|
10508
10520
|
const limitationNote = getColorLimitationNote();
|
|
10509
10521
|
if (limitationNote) {
|
|
10510
10522
|
console.log(limitationNote);
|
|
@@ -10518,7 +10530,7 @@ var main = defineCommand({
|
|
|
10518
10530
|
console.log(`# ${ramp.name}`);
|
|
10519
10531
|
}
|
|
10520
10532
|
ramp.colors.forEach((color) => {
|
|
10521
|
-
if (
|
|
10533
|
+
if (canShowPreview) {
|
|
10522
10534
|
const c4 = chroma_js_default(color);
|
|
10523
10535
|
const [r4, g3, b2] = c4.rgb();
|
|
10524
10536
|
const square = coloredSquare(r4, g3, b2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basiclines/rampa",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Generate mathematically accurate color palettes from a base color",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"build:linux-arm64": "bun build ./src/index.ts --compile --target=bun-linux-arm64 --outfile=./dist/rampa-linux-arm64",
|
|
23
23
|
"build:windows-x64": "bun build ./src/index.ts --compile --target=bun-windows-x64 --outfile=./dist/rampa-windows-x64.exe",
|
|
24
24
|
"build:all": "bun run build:darwin-arm64 && bun run build:darwin-x64 && bun run build:linux-x64 && bun run build:linux-arm64 && bun run build:windows-x64",
|
|
25
|
-
"release": "bun run scripts/release.ts"
|
|
25
|
+
"release": "bun run scripts/release.ts",
|
|
26
|
+
"eval": "bun run evals/src/runner.ts"
|
|
26
27
|
},
|
|
27
28
|
"repository": {
|
|
28
29
|
"type": "git",
|
|
@@ -44,8 +45,10 @@
|
|
|
44
45
|
"culori": "^4.0.1"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
48
|
+
"@github/copilot-sdk": "^0.1.23",
|
|
47
49
|
"@types/bun": "^1.2.17",
|
|
48
50
|
"@types/chroma-js": "^3.1.1",
|
|
51
|
+
"picocolors": "^1.1.1",
|
|
49
52
|
"typescript": "^5.5.3"
|
|
50
53
|
}
|
|
51
54
|
}
|