-
Notifications
You must be signed in to change notification settings - Fork 138
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
256-color support #14
Comments
For how to do 88-color stuff, see ~/Downloads/terminal-colors.py. |
We can now detect whether it's supported via |
From a reddit post by pheonix1701 (http://www.reddit.com/r/programming/comments/yeudv/blessings_15_a_python_replacement_for_curses/c5v05eo)...
|
This looks like an elegant solution to the problem, the method _closest_color could be modified to use .number_of_colors, and scan only the 256-color range on 256-color terminals, and only the 16 color range on 16-color terminals, which would allow rgb() values to map to the basic 16-bit color set. |
For clarification: I just tried the following:
It returned the expected result for a 256 colour terminal. Using values below 0 returned text with the default foreground, values above 255 wrapped around. So the colour for Given the internal code, this seems to be the behaviour of curses. I'm not quite sure about the So essentially, 256 colour support is already a thing of reality. A |
I designed a draft proposal in issues #67 |
Hi! I'm the author of Suplemon (https://github.com/richrd/suplemon) and I've been thinking of ditching curses. Blessings seems like a good fit, but I need 256 color support. This feature would be awesome! |
Blessed supports 24-bit and 256 colors, and is API compatible with blessings. https://blessed.readthedocs.io/en/latest/colors.html All X11 colors are available (hundreds? thousands?) in addition to the traditional 16 that blessings provides, and the nearest color is used for terminals only supporting 256 or 16 colors (at a bit of a cpu cost). All 24-bit colors are available using special thanks to @avylove who helped write most of it! |
Think about supporting 256-color palettes. If we do it, we should either be able to detect whether it's supported (via $TERM, or is there a cap we can check?) and/or provide transparent fallback to the nearest available color.
The text was updated successfully, but these errors were encountered: