This commit is contained in:
Dragon Fire
2021-03-28 13:21:37 -04:00
parent f4e89f7f9b
commit 45fff7ed8a
+3 -2
View File
@@ -137,8 +137,9 @@ module.exports = class CanvasUtil {
const outerRadius = width * 0.5;
const innerRadius = width * 0.2;
const grd = ctx.createRadialGradient(width / 2, height / 2, innerRadius, width / 2, height / 2, outerRadius);
for (let i = 0; i < 1; i += 0.1) {
grd.addColorStop(i, `rgba(0, 0, 0, ${i})`);
for (let i = 0; i < 0.9; i += 0.1) {
const num = Math.round(i * 10) / 10;
grd.addColorStop(num, `rgba(0, 0, 0, ${num})`);
}
ctx.fillStyle = grd;
ctx.fillRect(0, 0, width, height);