Open bjd-pfq opened 6 months ago
Hi, this sound interesting, i think i found a way for implement it, the only thing that i see is that it would only allow highlighting, i will see if it's possible implement the rest of features to this.
It would be fun to do implement I suppose. Prob. needs some lookup-table. Can said table be kept relatively small? It depends on how many discrete colors are used in a large corporate website. Maybe not even that many -- designers like to keep those things simple, because it's the most pleasing to the eye.
Your implementation must also recognize all the other ways to specify colors and alpha, like rainbow.el does, incl. hsl, rgb(a), etc.
And I'd make three character color-codes optional, like #fab et al. Raibow.el now colors all kinds of strings that I might have (like a comment in a bash script that reads "#defined at line thus and so' get its first 4 chars #def colored whereas it shouldn't). So options for minimal length, and also for omitting words like yellowstone, etc.
Btw., I have never looked at rainbow.el, so I wouldn't know how that is currently implemented. Maybe it works by regexing an entire buffer's visual part of its buffer after every edit?
Also, you prob. have heard of the new spectecular treesitter code coloring technique with emacs 29 and above. I have currently just built emacs 29 esp. because of that new feature, though haven't experimented with it yet. Might there be stuff in there that could be put to use for colored color-names or color-refs too?
Sorry for the late reply,
And I'd make three character color-codes optional, like #fab et al. Raibow.el now colors all kinds of strings that I might have (like a comment in a bash script that reads "#defined at line thus and so' get its first 4 chars #def colored whereas it shouldn't). So options for minimal length, and also for omitting words like yellowstone, etc.
colorful allows omitting color keywords (see: colorful-exclude-colors
), by default it omit #def
(for #define
) and it should work for all the colors keywords that colorful detects.
Also, you prob. have heard of the new spectecular treesitter code coloring technique with emacs 29 and above. I have currently just built emacs 29 esp. because of that new feature, though haven't experimented with it yet. Might there be stuff in there that could be put to use for colored color-names or color-refs too?
Can you provide more information about that?
If your program can be adapted to handle CSS user-defined colors, then I'm willing to try it out. E.g.: top of css: