mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Increase opacity
This commit is contained in:
@@ -34,7 +34,7 @@ module.exports = class TransCommand extends Command {
|
|||||||
const canvas = createCanvas(data.width, data.height);
|
const canvas = createCanvas(data.width, data.height);
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
ctx.drawImage(data, 0, 0);
|
ctx.drawImage(data, 0, 0);
|
||||||
ctx.globalAlpha = 0.5;
|
ctx.globalAlpha = 0.75;
|
||||||
ctx.drawImage(transFlag, 0, 0, data.width, data.height);
|
ctx.drawImage(transFlag, 0, 0, data.width, data.height);
|
||||||
const attachment = canvas.toBuffer('image/png');
|
const attachment = canvas.toBuffer('image/png');
|
||||||
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
|
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
|
||||||
|
|||||||
Reference in New Issue
Block a user