1 Star 0 Fork 0

lan-online/common

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
colors.go 504 Bytes
Copy Edit Raw Blame History
lan-online authored 2022-11-08 05:20 +08:00 . 第一次提交
package colors
import "image/color"
var (
Black = color.NRGBA{A: 255}
White = color.NRGBA{R: 255, G: 255, B: 255, A: 255}
Red = color.NRGBA{R: 255, A: 255}
Green = color.NRGBA{G: 255, A: 255}
Blue = color.NRGBA{B: 255, A: 255}
None = color.NRGBA{A: 0}
)
func checkColor(s uint8) uint8 {
if s < 0 {
s = 0
} else if s > 255 {
s = 255
}
return s
}
func NRGBA(r, g, b, a uint8) color.NRGBA {
return color.NRGBA{R: checkColor(r), G: checkColor(g), B: checkColor(b), A: checkColor(a)}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/lan-online/common.git
git@gitee.com:lan-online/common.git
lan-online
common
common
v1.0.8

Search