PickColor
返回图像指定坐标的颜色。
参数
参数名
类型
说明
x
int
坐标 x 轴
y
int
坐标 y 轴
返回值
color.RGBA
类型的颜色。
例子
package main
import (
"fmt"
"github.com/fishtailstudio/imgo"
)
func main() {
r, g, b, a := imgo.Load("gopher.png").
PickColor(50, 50).
RGBA()
fmt.Println(r, g, b, a)
}
最后更新于