aha
aha copied to clipboard
Color improvements
This PR makes a few improvements to Aha's color handling:
- It creates a test program
test_print.c
which outputs a page of formatting codes to test Aha with - It replaces the old
highlighted
flag with proper 4-bit color support, including.bg-highlighted
for independent foreground/background highlighting. Other than that I made sure to maintain CSS backward compatibility, which is why I stuck with the old.highlighted.<color>
classes instead of doing separate classes for the normal and bright versions of colors. - Fixes a bug where a non-4-bit foreground color and a 4-bit background color would end up placing the 4-bit background class (e.g.
bg-red
) in the tag'sstyle
attribute instead of theclass
attribute. - It supplements the built-in color schemes with configurable ones using the
--colors
parameter
Because highlighting no longer uses a CSS filter and instead is a separate color, at the moment the built-in color schemes have no normal/bright distinction. I didn't want to go ahead and decide on a color scheme since, in the end, it's your project.