填充颜色
()
| 397 | |
| 398 | // 填充颜色 |
| 399 | func (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 | // 截断文字 |
| 415 | func truncate(one *gg.Context, text string, maxW float64) (string, float64) { |
no outgoing calls
no test coverage detected