GithubHelp home page GithubHelp logo

Comments (5)

markus-oberhumer avatar markus-oberhumer commented on June 11, 2024 1

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.

sharkdp avatar sharkdp commented on June 11, 2024

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.

markus-oberhumer avatar markus-oberhumer commented on June 11, 2024

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.

devhell avatar devhell commented on June 11, 2024

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.

Vinegret43 avatar Vinegret43 commented on June 11, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.