MCPcopy Create free account
hub / github.com/FloatTech/ZeroBot-Plugin-Playground / randfill

Method randfill

plugin/draw/draw.go:399–412  ·  view source on GitHub ↗

填充颜色

()

Source from the content-addressed store, hash-verified

397
398// 填充颜色
399func (titlec *titleColor) randfill() {
400 titlec.r = rand.Intn(245) // 随机颜色
401 titlec.g = rand.Intn(245)
402 titlec.b = rand.Intn(245)
403 for titlec.r < 15 || titlec.r > 210 {
404 titlec.r = rand.Intn(245)
405 }
406 for titlec.g < 15 || titlec.g > 210 {
407 titlec.g = rand.Intn(245)
408 }
409 for titlec.b < 15 || titlec.b > 210 {
410 titlec.b = rand.Intn(245)
411 }
412}
413
414// 截断文字
415func truncate(one *gg.Context, text string, maxW float64) (string, float64) {

Callers 3

createPicMethod · 0.95
drawscMethod · 0.95
createPic2Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected