fix: 修复透明度
This commit is contained in:
parent
444be993c3
commit
b75ea17364
@ -168,9 +168,9 @@ func GenerateCongratulationImageNew(text string, inputFile, outputFile string, i
|
|||||||
var textColor color.RGBA
|
var textColor color.RGBA
|
||||||
if isGood {
|
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 {
|
} 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)
|
textImage, err := text2img.RenderTextToTrimmedImage(nil, text, 48, textColor, 0, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user