-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support all named colors from X11 rgb.txt #138
Comments
Thank you for your feedback. I'm okay with adding these color names. I'm not sure if they should show by default when calling As for the name clashes: maybe we could prefix all of them with x11? But then there's the issue of discoverability. See also: #32 |
I agree that this might be an UI issue. So prefixing all colors with |
The following small Python program #!/usr/bin/env python3
import re
# NOTE: wget https://cgit.freedesktop.org/xorg/app/rgb/plain/rgb.txt
lines = open("rgb.txt").read().splitlines()
colors = []
for l in lines:
m = re.match(r"^(\d+)\s+(\d+)\s+(\d+)\s+(.*)", l.strip())
if m:
colors.append([m.group(4), m.group(1), m.group(2), m.group(3)])
print(f'// {len(colors)} X11 colors')
for name, r, g, b in sorted(colors):
print(f' named_color("x11-{name}", {r}, {g}, {b}),' creates 782 entries in the form of
for inclusion into After compiling |
This would be awesome! I've been trying to create various colorschemes for programs that only have support for xterm-type colors, and would thoroughly enjoy having the ability to match colors to their nearest xterm equivalent. Thank you for such a thoughtful and amazing tool! Prost! 🍻 |
@sharkdp, maybe we could add something like '--all' option for list command that will display all colors, and without this option it will display only base colors, excluding X11, this will solve problem with discoverability. (i'm working on this issue right now and just want to know your opinion about adding this option, i already tested it on my machine) Also, X11's rgb.txt has some color names which consist of multiple words (They are just synonyms for their single-worded alternatives, like 'royal blue' and 'royalblue'). The question is: should i delete these multi-worded synonyms from the list? |
Just came across this nice program, only to realize that it is missing many named colors:
Please see https://en.wikipedia.org/wiki/X11_color_names and https://cgit.freedesktop.org/xorg/app/rgb/tree/rgb.txt .
The few clashing color names could be resolved by using a
x11-
prefix like inx11-gray
.The text was updated successfully, but these errors were encountered: