Closed net closed 5 months ago
Unfortunately I do not have plan to support that. I intentionally want to keep the tool simple enough. But I can imagine there are different flavors of color schema, so I am open to accept contribution :).
@ymattw Can you point out in the code where the colors are set?
This could easily be done by having a config file that ydiff
reads from, but for any configuration settings not set, or if the config file is missing entirely, it will just use some defaults. That's what I would do.
I may be able to help out here:
@ymattw Can you point out in the code where the colors are set?
The color definition is not exactly hard to find if you try just a little bit: https://github.com/ymattw/ydiff/blob/ce8f7a11a4eb27558173a1a7620adef21784eadb/ydiff.py#L43-L60
These are ANSI escape codes, and are sort of the least common denominator for encoding colors across terminal applications.
ydiff uses the 3/4bit ones, which essentially mean there are 16 basic named colors (in order: black, red, green, yellow, blue, magenta, cyan, white; and their respective bright- variants), which exact RGB-value is set by your terminal. So if you just wanted a lighter/darker shade of red, adjust your terminal accordingly. If you wanted magenta/cyan instead of red/green, you would just change the ANSI escape code in that color-definition above.
There are two other modes: 8bit (256 colors) and 24bit (full RGB, 32M colors). Many terminal today do have "truecolor" support, but some don't and never will (basic xterm has not, for example).
And doing truecolor-support the right way is hard. For your "simple" suggestion, you'd have to have to do:
All in all probably too much hassle for a tool that just displays two colors.
Is there a way to customize the specific colors (foreground and background) ydiff uses?