Skip to content

Conversation

Volte6
Copy link
Member

@Volte6 Volte6 commented May 14, 2025

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

  • Renaming color256: in ansi-alias file to simply colors
    • color256 remains supported.
  • Eliminated code related to 4-bit colors
    • Updated unit tests
  • Added rgb.go - provides RGB(int) which accepts a color code and returns an rgb struct/object
    • unit tests
  • Added ansitags.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:

image

@Volte6 Volte6 merged commit 881c9a5 into master May 14, 2025
@Volte6 Volte6 deleted the rgb-conversion branch May 14, 2025 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant