PickColor

Returns the color at the specified coordinates of the image.

Parameters

Parameter
Type
Description

x

int

coordinate x axis

y

int

coordinate y axis

Return Values

Color of color.RGBA.

Examples

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)
}

Last updated