feat: Add colored console output support (fixes #15) - #17
Merged
smiley-maker merged 1 commit intoDec 15, 2025
Merged
Conversation
Add a new colors module that provides ANSI color codes and utilities
for personality-specific colored output.
Features:
- ANSI color constants (RED, GREEN, BLUE, BOLD, etc.)
- colorize() function to apply colors to text
- strip_colors() function to remove ANSI codes
- Personality-specific color schemes (PERSONALITY_COLORS)
- ColoredPrinter class for use as print_fn
- create_colored_print_fn() convenience function
Each personality has its own color scheme:
- wholesome: Green, bold
- sassy: Magenta, bold
- nervous: Yellow
- chaotic: Bright magenta, bold
- arrogant: Cyan, italic
- tired: Dim, italic
- hype: Bright yellow, bold
- academic: Blue
- pirate: Bright red, bold
- zen: Bright cyan, dim
Usage:
```python
from emotigrad import EmotionalOptimizer, ColoredPrinter
printer = ColoredPrinter("hype")
emo_opt = EmotionalOptimizer(optimizer, personality="hype", print_fn=printer)
```
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
|
Love this addition! The colored output makes the feedback much easier to read and adds a lot of personality to the training loop. Really appreciate you implementing this so cleanly and adding tests for the feature. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add a new colors module that provides ANSI color codes and utilities for personality-specific colored output.
Features
Usage
Test Plan
Fixes #15