fix: 修复透明度

This commit is contained in:
lixiangwuxian 2025-05-15 11:00:48 +08:00
parent 444be993c3
commit b75ea17364

View File

@ -168,9 +168,9 @@ func GenerateCongratulationImageNew(text string, inputFile, outputFile string, i
var textColor color.RGBA
if isGood {
// 设置文本颜色为红色
textColor = color.RGBA{R: 255 * 0.8, G: 0, B: 0, A: 255}
textColor = color.RGBA{R: 255 * 0.8, G: 0, B: 0, A: 0}
} else {
textColor = color.RGBA{R: 0, G: 0, B: 255 * 0.8, A: 255}
textColor = color.RGBA{R: 0, G: 0, B: 255 * 0.8, A: 0}
}
textImage, err := text2img.RenderTextToTrimmedImage(nil, text, 48, textColor, 0, 0)
if err != nil {