-
Notifications
You must be signed in to change notification settings - Fork 27
Add support for 256color xterm codes #2
base: master
Are you sure you want to change the base?
Add support for 256color xterm codes #2
Conversation
jordansissel
commented
Jul 13, 2014
- 216-color RGB cube is supported as 'rgb' with range 0-5 for each color
- 16-color Grayscale is supported as 'grayN' where N is 0-15
|
Visual test code: https://gist.github.com/jordansissel/49f3a76681987b08de4e |
|
Ready for review! Specific feedback requested:
|
* 216-color RGB cube is supported as 'rgb' with range 0-5 for each color * 16-color Grayscale is supported as 'grayN' where N is 0-15
fmt.Printf("%s\n", colorstring.Color("[_200_]this should be red"))
fmt.Printf("%s\n", colorstring.Color("[_020_]this should be green"))
fmt.Printf("%s\n", colorstring.Color("[_002_]this should be blue"))
fmt.Printf("%s\n", colorstring.Color("[_220_]this should be yellow"))
fmt.Printf("%s\n", colorstring.Color("[_022_]this should be cyan"))
fmt.Printf("%s\n", colorstring.Color("[_202_]this should be purple"))
fmt.Printf("%s\n", colorstring.Color("[_222_]this should be grey")) |
|
Hey! Looks good. Questoin: why not just use the 256-color color number as shown here? http://misc.flogisoft.com/bash/tip_colors_and_formatting Is the 0-6 "intensity" of a color some standard thing I'm unaware of? It might be easier to use the color numbers because then people can look it up. No? |
|
The reason for the rgb syntax is that the numbers don't really have semantic meaning. Like colors in the web, where we do So terminal colors, is 216 colors of a 6x6x6 cube, so I picked base 6 (0-5) encoded as 3 digits RGB. Much easier for me to predict what a color will be |
|
This is reasonable. Let me take one quick review again tomorrow or tonight then I'll merge it in. Thanks! |
|
256 color support would be great. Any update on this? |
|
@mitchellh bump? ^ :) |


