Back to

package pic

v0.0.0 (0608bab)
Latest Go to latest
Published: May 8, 2020 | License: BSD-3-Clause | Module:


Package pic implements functions that display pictures on the Go playground.



func Show

func Show(f func(dx, dy int) [][]uint8)

Show displays a picture defined by the function f when executed on the Go Playground.

f should return a slice of length dy, each element of which is a slice of dx 8-bit unsigned int. The integers are interpreted as bluescale values, where the value 0 means full blue, and the value 255 means full white.



f := func(dx, dy int) [][]uint8 {
	ss := make([][]uint8, dy)
	for y := 0; y < dy; y++ {
		s := make([]uint8, dx)
		for x := 0; x < dx; x++ {
			s[x] = uint8((x + y) / 2)
		ss[y] = s
	return ss




func ShowImage

func ShowImage(m image.Image)

ShowImage displays the image m when executed on the Go Playground.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier