Skip to content

Commit e35fde2

Browse files
committed
feat (image-sizes): add logoOpacity option
1 parent 9cc98dc commit e35fde2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

config/image-sizes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const regex = {
2121
const imageSettings = {
2222
fill: '#f1e25b',
2323
logo: './src/img/static/logo-beapi.svg',
24+
logoOpacity: 1,
2425
logoScale: 0.5,
2526
}
2627
const locations = {}
@@ -196,6 +197,7 @@ function generateDefaultImage(sizes, filename) {
196197
logoHeight = (logoWidth * image.naturalHeight) / image.naturalWidth
197198
}
198199

200+
context.globalAlpha = imageSettings.logoOpacity
199201
context.drawImage(image, (width - logoWidth) / 2, (height - logoHeight) / 2, logoWidth, logoHeight)
200202

201203
const buffer = canvas.toBuffer('image/jpeg')

0 commit comments

Comments
 (0)