jonasjacek / colors

List of 256 color codes for Xterm including an example of the color, Xterm Name, Xterm Number, HEX, RGB and HSL code.
https://www.ditig.com/publications/256-colors-cheat-sheet
Creative Commons Attribution Share Alike 4.0 International
88 stars 22 forks source link

source? #1

Closed nhooyr closed 6 years ago

nhooyr commented 8 years ago

How did you get all of the colors names and values?

Otherwise thank you, this will be useful to me.

nhooyr commented 8 years ago

Hmm I noticed there are some duplicates, e.g. DeepSkyBlue4 is in the table 3 times. How should I differentiate between the three? DeepSkyBlue4_1 or DeepSkyBlue41. Any ideas?

jonasjacek commented 8 years ago

Hi @nhooyr, thank you for getting back to me with your question. I have compiled the list by hand a couple of years ago. It took me a while and I cannot completely remember how I did it.

I was able to find the DeepSkyBlue versions in several other references, so I assume my listing is correct.

See: http://www.graphviz.org/doc/info/colors.html http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim

On the other hand, there are references, where the RGB codes do not match my HEX codes: http://bradbury.org/jim/xtermcolors.html

I do not know who is right or wrong. I think I have to look into this again, when I have more time on my hands. For now, I cannot help. However, thank you for taking the time to report this!

drstevenhale commented 7 years ago

Hello @jonasjacek,

I've just encountered this problem myself. I've spent the best part of a day on it and have come to the conclusion that there aren't any definitive names for the ANSI256 colour palette. There's lots of confusion between the X11 colour scheme and ANSI256. The first link you've given is for X11 (values from /usr/bin/showrgb from file /usr/share/X11/rgb.txt) and so it doesn't help. The last link claims to be for xterm but again it too is actually for X11. The closest is the second link but as I discovered, and as pointed out by @nhooyr, it contains lots of duplicate names and so is useless as a definitive palette description.

This figure,

https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg

appears to be a true and complete ANSI256 colour chart. It only provides index number and RGB hex values. There are no names. I think in my code I'm just going to scrap the names and stick to addressing by index value and RGB. Shame really as names are intuitive.

If anyone does come up with a unique list of names for ANSI256 please do let me know!

Steve.

nhooyr commented 7 years ago

@tweekmonster showed me this script that gives the RGB colors for the terminal index.

https://github.com/tweekmonster/shellcolors/blob/acc1b0b44d938c44f36f3b1ca1fc280352cad594/shellcolors#L36-L57

It is also documented at https://en.wikipedia.org/wiki/ANSI_escape_code#Colors

bdw429s commented 6 years ago

I submitted a pull that removes all duplicate color names: https://github.com/jonasjacek/colors/pull/4 It's not based on any format spec or anything. I just wrote a script to find the dupes and edited them all by hand to a reasonable new name.

jonasjacek commented 6 years ago

@bdw429s thank you for your effort. I am unsure if merging your pull is useful. I am of the opinion that there should be multiple different versions of the color cheat sheet in this repository. See comment above: https://github.com/jonasjacek/colors/issues/1#issuecomment-280899062).

I am afraid new color names will only add to the confusion instead of bringing clariry.