Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light/Dark colors dont work #36

Closed
noobmldude opened this issue Jan 3, 2023 · 3 comments
Closed

Light/Dark colors dont work #36

noobmldude opened this issue Jan 3, 2023 · 3 comments

Comments

@noobmldude
Copy link

noobmldude commented Jan 3, 2023

I see error when I try to use the recently added colors (light/dark , black)

Traceback (most recent call last):
  File "/Users/noob/Documents/code-sandbox/py/python-experiments/termcolor-test.py", line 60, in <module>
    cprint(f"Color: {c}", c, attrs=["bold"])
  File "/Users/noob/.pyenv/versions/3.9.14/lib/python3.9/site-packages/termcolor/termcolor.py", line 171, in cprint
    print((colored(text, color, on_color, attrs)), **kwargs)
  File "/Users/noob/.pyenv/versions/3.9.14/lib/python3.9/site-packages/termcolor/termcolor.py", line 147, in colored
    text = fmt_str % (COLORS[color], text)
KeyError: 'black'

Even when running the demo I only see the limited colors (as opposed to screenshot in PR #32)
Screenshot 2023-01-03 at 17 38 20

My version is 2.1.1

╰─ pip show termcolor                                                                                                                                                                                                                                                                                                     
Name: termcolor
Version: 2.1.1
Summary: ANSI color formatting for output in terminal
Home-page: 
Author: 
Author-email: Konstantin Lepa <konstantin.lepa@gmail.com>
License: MIT

Tried on both MacOS Terminal and Alacritty with zsh.

Is there something I'm missing here?
How could I use the new color shades?

@hugovk
Copy link
Member

hugovk commented Jan 3, 2023

PR #32 hadn't been released yet, but I've just put out it out in https://github.com/termcolor/termcolor/releases/tag/2.2.0 🚀

image

@hugovk hugovk closed this as completed Jan 3, 2023
@noobmldude
Copy link
Author

oh My bad. I saw the README and assumed it's released.
Thanks for the new version. Hope you didn't have to rush your release due to this issue.

I confirm that the colors work with the new version 2.2.0.
image

@hugovk
Copy link
Member

hugovk commented Jan 3, 2023

You're welcome! It was no problem to release, I have a lot of automation in place so it was literally two clicks: edit release draft, publish.

https://github.com/termcolor/termcolor/blob/main/RELEASING.md

Release early, release often :)

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

No branches or pull requests

2 participants