Skip to content

Instantly share code, notes, and snippets.

@wojciech-zurek
Created April 24, 2020 10:04
Show Gist options
  • Save wojciech-zurek/7a95d27636d148e2f076558019e1093b to your computer and use it in GitHub Desktop.
Save wojciech-zurek/7a95d27636d148e2f076558019e1093b to your computer and use it in GitHub Desktop.
Go lang and ANSI 256 colors
package main
import (
"fmt"
)
const Color = "\033[38;5;%dm%-4d\033[39;49m"
func main() {
for row := 0; row < 16; row++ {
for col := 0; col < 16; col++ {
code := row*16 + col
fmt.Printf(Color, code, code)
}
fmt.Println()
}
}
@wojciech-zurek
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment