Skip to content

Commit 65e531c

Browse files
authored
fix: font color & background logo (#11)
* fix:font color & background logo * make lint happy
1 parent ef4723c commit 65e531c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

serverpic.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,23 @@ func RenderServerPic(pluginlist []*PluginInfo, torussd, glowsd []byte, zbplogopa
2929
h := serverlistlogo.Bounds().Dy() + ln*(80+16) + serverlistlogo.Bounds().Dy()/3
3030
canvas := gg.NewContext(w, h)
3131

32+
canvas.SetRGBA255(235, 235, 235, 127)
33+
canvas.Clear()
34+
35+
halfalphamask := canvas.AsMask()
36+
3237
canvas.SetRGBA255(235, 235, 235, 255)
3338
canvas.Clear()
3439

40+
err = canvas.SetMask(halfalphamask)
41+
if err != nil {
42+
return
43+
}
44+
45+
canvas.DrawImageAnchored(logo, canvas.W()/2, canvas.H()/2, 0.5, 0.5)
46+
47+
canvas.ResetClip()
48+
3549
canvas.SetRGBA255(135, 144, 173, 255)
3650
canvas.NewSubPath()
3751
canvas.MoveTo(0, 0)
@@ -204,7 +218,7 @@ func renderinfocards(torussd, glowsd []byte, plugininfos []*PluginInfo) (img ima
204218
if err != nil {
205219
return
206220
}
207-
canvas.SetRGBA255(235, 235, 235, 255)
221+
canvas.SetRGBA255(20, 20, 20, 255)
208222
beginw, beginh = 24.0, 0.0
209223
for i := 0; i < cardnum; i++ {
210224
canvas.DrawStringAnchored(plugininfos[i].Name, beginw+14, beginh+canvas.FontHeight()/2+4, 0, 0.5)

0 commit comments

Comments
 (0)