Files
Sisyphus (主代理) 02762400fb chore: 项目基线提交 - 拼豆图纸生成器 V1.0 核心代码
- 前端: React+Vite 首页/AI专区, 算法库(MARD色板/量化/背景去除), API对接
- 后端: Express+SQLite, 兑换码/订单/支付/chibi生成, 风控+云端同步
- CI/CD: GitHub Actions + Docker + nginx 配置
- 文档: PRD/DESIGN/LAUNCH/ROADMAP/E2E/竞品对照等 15 份
- 工程: 任务看板(taskboard) + 健康巡检(agent-health) + Git流程(gitflow)
2026-08-13 21:40:27 +08:00

37 lines
1.1 KiB
JavaScript

const fs = require('fs');
// Generate a compact, strictly-typed TypeScript module from the extracted palette JSON.
const palette = JSON.parse(
fs.readFileSync('D:/拼豆/competitor-analysis/mard-palette.json', 'utf8'),
);
const lines = [];
lines.push('/**');
lines.push(' * MARD 拼豆色板 — all colors, extracted from the competitor bundle.');
lines.push(' *');
lines.push(' * Each entry carries the MARD code, hex, sRGB and precomputed CIE LAB (D65) values.');
lines.push(' */');
lines.push('');
lines.push('export interface MardColor {');
lines.push(' code: string;');
lines.push(' hex: string;');
lines.push(' rgb: [number, number, number];');
lines.push(' lab: [number, number, number];');
lines.push('}');
lines.push('');
lines.push('export const MARD_PALETTE: readonly MardColor[] = [');
for (const c of palette) {
lines.push(
` { code: '${c.code}', hex: '${c.hex}', rgb: [${c.rgb.join(', ')}], lab: [${c.lab.join(', ')}] },`,
);
}
lines.push('];');
lines.push('');
fs.writeFileSync(
'D:/拼豆/perler-lab/src/lib/mard-palette-data.ts',
lines.join('\n'),
'utf8',
);
console.log('generated entries:', palette.length);