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
@@ -1,4 +1,5 @@
import { getImage } from '../../utils/index';
import { getRandomNumberColor } from '../../constants/colors';
interface DrawCountMatchContentParams {
canvas: WechatMiniprogram.Canvas;
@@ -130,8 +131,8 @@ export async function drawCountMatchContent({
true,
);
// 绘制数字
ctx.fillStyle = '#000';
// 绘制数字(使用随机颜色)
ctx.fillStyle = getRandomNumberColor();
ctx.font = `bold ${56}px "Microsoft Yahei"`;
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';