Coder Social home page Coder Social logo

source? about colors HOT 6 CLOSED

jonasjacek avatar jonasjacek commented on May 30, 2024
source?

from colors.

Comments (6)

drstevenhale avatar drstevenhale commented on May 30, 2024 2

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.

from colors.

jonasjacek avatar jonasjacek commented on May 30, 2024 1

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!

from colors.

nhooyr avatar nhooyr commented on May 30, 2024 1

@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

from colors.

nhooyr avatar nhooyr commented on May 30, 2024

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?

from colors.

bdw429s avatar bdw429s commented on May 30, 2024

I submitted a pull that removes all duplicate color names:
#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.

from colors.

jonasjacek avatar jonasjacek commented on May 30, 2024

@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: #1 (comment)).

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

from colors.

Related Issues (8)

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.