- 前端: 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)
37 lines
1.1 KiB
JavaScript
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); |