Created
April 24, 2020 10:04
-
-
Save wojciech-zurek/7a95d27636d148e2f076558019e1093b to your computer and use it in GitHub Desktop.
Go lang and ANSI 256 colors
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
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() | |
} | |
} |
Author
wojciech-zurek
commented
Apr 24, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment