Eliminate 4-bit colors, add RGB conversion tools, HTML parse mode #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This eliminates support for 16-color (4-bit) colors, an unused feature that increases complexity.
It also adds a new parsing mode to convert tags into HTML output (
<span>
)Changes
color256:
in ansi-alias file to simplycolors
color256
remains supported.rgb.go
- providesRGB(int)
which accepts a color code and returns anrgb
struct/objectansitags.HTML
as a parse mode for output.Notes
Since an XML-like tag structure is used for tags, you could really cheat this with string (or regex) replacements, but this maintains the ability to process a stream of data, such as that piped in from another program.
Whether that's useful or not remains to be seen.
Example
Here is a side-by-side of a web-render of the html output vs. an in-terminal output using ansi escape codes: