Skip to content

Instantly share code, notes, and snippets.

@jochasinga
Created September 30, 2014 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jochasinga/3fc186da6844c7d5ada6 to your computer and use it in GitHub Desktop.
Save jochasinga/3fc186da6844c7d5ada6 to your computer and use it in GitHub Desktop.
Function in Go
package main
import "fmt"
func colormap(r uint8, g uint8, b uint8) (color map[string]uint8) {
color := map[string]uint8{
"r" : r
"g" : g,
"b" : b,
}
// return color
return
}
func main() {
fmt.Println(colormap(255, 255, 255))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment