Created
January 13, 2014 00:39
-
-
Save railscard/8392793 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imgColorAt := img.At(x, y) | |
red, green, blue, alpha := imgColorAt.RGBA() | |
rgbaColor := color.RGBA{uint8(red >> 8), uint8(green >> 8), uint8(blue >> 8), uint8(alpha >> 8)} | |
fmt.Println(imgColorAt) // Will print {255 255 255 0} | |
fmt.Println(rgbaColor) // Will be {0 0 0 0} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment