Comments (5)
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
named_color("x11-AliceBlue", 240, 248, 255),
named_color("x11-AntiqueWhite", 250, 235, 215),
...
for inclusion into src/named.rs
.
After compiling pastel list
seems to work, but pastel color x11-red
does not - probably some issue with the parser.
from pastel.
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 pastel list
though.
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
from pastel.
I agree that this might be an UI issue.
So prefixing all colors with x11-
and (maybe) hiding them from pastel list
would be fine.
from pastel.
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! 🍻
from pastel.
@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?
from pastel.
Related Issues (20)
- Option for more compact display of multiple colors. HOT 3
- Support "short" display option? HOT 2
- github release v0.8.1 HOT 2
- Most similar colors option HOT 1
- fzf preview window does not show colors from pastel's output HOT 5
- Colorpicker options HOT 2
- Rotate in La*b* space HOT 1
- `pick` error HOT 4
- How to print ansi reset code (`\e[m`)? HOT 11
- How to create background colors with `pastel format`? HOT 1
- Can this Generate a Sequence of Color Shade strings? HOT 3
- Performance issue with the redundancy operations HOT 1
- [pastel error]: Could not find any external color picker tool HOT 2
- Picking directly from terminal HOT 2
- It would be great to be able to paint gradients in TMUX and Powerline directly with pastel HOT 1
- Feature request: Short name for some commands HOT 1
- The bars doesn't show colors HOT 1
- colorcheck not in commands list ? HOT 3
- `pastel pick` does not work and suggests unhelpful advice. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pastel.