MCPcopy Create free account
hub / github.com/FloatTech/NanoBot-Plugin / customrectangle

Function customrectangle

plugin/score/draw.go:172–183  ·  view source on GitHub ↗
(cw, ch, aw, ah, namew float64, rtgcolor color.Color)

Source from the content-addressed store, hash-verified

170}
171
172func customrectangle(cw, ch, aw, ah, namew float64, rtgcolor color.Color) (img image.Image) {
173 canvas := gg.NewContext(int(cw), int(ch))
174 sch := ch * 6 / 10
175 canvas.DrawRoundedRectangle((ch-sch)/2/2-aw/2-aw/40, (ch-sch)/2/2-aw/2-ah/40, aw+aw/40*2, ah+ah/40*2, 8)
176 canvas.SetColor(rtgcolor)
177 canvas.Fill()
178 canvas.DrawRoundedRectangle((ch-sch)/2/2, (ch-sch)/2/2-ah/4, aw/2+aw/40*5+namew, ah/2, 8)
179 canvas.Fill()
180
181 img = canvas.Image()
182 return
183}
184
185func customtext(a *scoredata, fontdata []byte, cw, ch, aw float64, textcolor color.Color) (img image.Image, err error) {
186 canvas := gg.NewContext(int(cw), int(ch))

Callers 1

floatstyleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected