3 ms·
I'd probably do something like this: colors := []string{"0", "4", "2", "6", "1", "5", "3", "7", "0", "4", "2", "6", "1", "5", "3"} bg := colors[(b & 0x
by lunixbochs 12y ago
I'd probably do something like this:
colors := []string{"0", "4", "2", "6", "1", "5", "3", "7", "0", "4", "2", "6", "1", "5", "3"}
bg := colors[(b & 0xF0) >> 8]
fg := colors[b & 0x0F]
fmt.Sprintf("\x1B[4%d;3%dm", bg, fg)
- benjojo12 12y agoYup! Thats much better, Thanks