Skip to content

Add ability to use 256-color ANSI codes#129

Open
Ashe-Sterling wants to merge 2 commits into
mkaz:mainfrom
Ashe-Sterling:Add-ANSI-Colors
Open

Add ability to use 256-color ANSI codes#129
Ashe-Sterling wants to merge 2 commits into
mkaz:mainfrom
Ashe-Sterling:Add-ANSI-Colors

Conversation

@Ashe-Sterling

@Ashe-Sterling Ashe-Sterling commented Jun 16, 2026

Copy link
Copy Markdown

What changed:

  • Colors are now printed by explicitly setting the foreground color with \033[38;5;{color}m
    • This allows users to pass ANSI color codes as well as the existing named colors to both the CLI tool and the API
  • Color validation is now its own internal function
    • This worked when testing on Windows without specifically needing to # Decompose arguments for Windows as was done previously, so I did not integrate it into this implementation of the colorargs validation
  • Updated constants.AVAILABLE_COLORS values to match the new printing method

I did not specifically add a new test for this as it seems pretty well covered by existing tests.

…n and always colorize by explicitly setting the foreground color.
@mkaz mkaz requested a review from Copilot June 16, 2026 20:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment thread termgraph/termgraph.py Outdated
I meant for this to be a TypeError, but there's no real reason to narrow the scope of this catch. My apologies for not catching that before submitting the PR.
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.

2 participants