feat:代码优化
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user