Closed ryanerwin closed 6 years ago
Seems easy to add https://en.wikipedia.org/wiki/ANSI_escape_code#Colors I will try to add this, when I find time :) You could help me a lot with an example file, which produces theses terminal colors with
cat file.txt
Best Alex
Here you go. You can cat these files back to your terminal and you should see:
Works for me, thanks! However Konsole
shows a lot of \
in front of System colors
. xterm
works better. Seems to me like a escape code Konsole
even doesn't understand. XD
Anyway, I will give it a try with these files ;)
FYI Because of filtered access at work I use Wetty (a web terminal) Both files shows very well in it.
once again I look into doing something fun and theZiz has been there already! :)
I do find myself not getting proper color output. These guys seem to do it right.
https://pypi.python.org/pypi/ansi2html/1.0.7
https://files.catbox.moe/h8o8v8.png
Can share source .ans files if you want.
How about adding support for the now ubiquitous "bright"/"light"/"high intensity" colors (escape codes 90–97 and 100–107)?
I think I overcame some of the issues... at least what I created works for me and lets me continue on a project that requires having color coded log file outpus which aha facilitates. See Issue #52.
I added support for 256 colors. The first example is working now, next step 24 bit :sunglasses:
@hftf I added support for bright intensity colors with 8 bit. I could use the same method for 90-97 and 100-107. Could you provide an example file for testing?
Hopefully added full support for 8 and 24 bit colors. Please test! :smiley:
@hftf Awesome, thanks!
@hftf Okay, I gave it a try. While doing this I noticed that I had two errors in my sooner commits. First of all the 8 and 24 bit colours did not work with stylesheets (they do now) and secondly the highlighted is always done for BOTH, the foreground and background colour. I did not fix this as it would make the solution way more complex. Right now I am just applying a filter which decreases the contrast and increases the saturation, which makes all colour look more highlighted. However I cannot apply this filter only to the foreground or background colour. So I would need to define 16 new colours if I would like to implement it per colour type... :roll_eyes:
At least your example is working and I guess in the real world, it will look fine, too. If there is really a real world application which looks awful with this solution, I may think about a more correct implementation. :stuck_out_tongue:
While the values are not standardized, it seems less complex to me to implement them by just defining 16 new colors: See e.g. https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit for a table of existing values you can use.
I have two reasons why I decided for the way I went:
highlighted
class is not known and just the not highlighted color used. Adding the highlighted
class however is done quite fast and the developer does not have to decide which highlighted colors match best for his or her own stylesheet
Hello,
Curious if you might consider updating aha to include 256 color support, and ideally even true color support? For example, I have several scripts using Term::ExtendedColor to generate console colors...
Best,
Ryan