feat:代码优化

This commit is contained in:
R524809
2025-12-04 17:26:04 +08:00
parent 7f8a9b1c4d
commit c8788669c7
23 changed files with 339 additions and 428 deletions
+34
View File
@@ -85,6 +85,40 @@ export const WATER_COLORS = {
],
};
/**
* 数字颜色映射(柔和12色)
* 用于数学页面的数字显示和涂色
*/
export const NUMBER_COLORS: Record<number, string> = {
1: '#ED6D50', // 柔和红色
2: '#F9A857', // 柔和橙色
3: '#FFE176', // 柔和黄色
4: '#B2D94B', // 柔和黄绿色
5: '#53D1B6', // 柔和绿色
6: '#6CD2EA', // 柔和青色
7: '#79A7ED', // 柔和蓝色
8: '#9C98DE', // 柔和紫色
9: '#F2A4C0', // 柔和粉色
10: '#FC9B6C', // 柔和橙红色
11: '#BC8F71', // 柔和棕色
12: '#666666', // 柔和黑灰
};
/**
* 获取所有数字颜色数组
*/
export function getNumberColors(): string[] {
return Object.values(NUMBER_COLORS);
}
/**
* 随机获取一个数字颜色
*/
export function getRandomNumberColor(): string {
const colors = getNumberColors();
return colors[Math.floor(Math.random() * colors.length)];
}
export const PAPER_SIZE = {
A4: {
// width: 2480,