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

Implement setf & setb #314

Closed
mjsir911 opened this issue Nov 19, 2019 · 2 comments
Closed

Implement setf & setb #314

mjsir911 opened this issue Nov 19, 2019 · 2 comments
Assignees
Milestone

Comments

@mjsir911
Copy link

mjsir911 commented Nov 19, 2019

Hi,

Currently, it seems like tcell only supports setting the colors using setfg & setbg.

This has left a hole in functionality, resulting in many issues in projects using it:

Supporting setf & setb will allow using colors with custom colorsets, which respect the terminal emulator's own theming styles. This saves projects from having to implement their own colorscheme configurations as seen in some of the issues above. This will only be the case when a small amount of colors are being used, but at least some projects do this

Supporting custom semantic colorschemes also help with user's with vision problems who have customized the terminal colorscheme to help with that.

See colortools for how it works on xterm compatible terminals.

default background & foreground

Additionally, on xterm, 39 and 49 are the background and foreground colors respectively. This will help with some of the issues of incorrect background colors. This is both implemented in ncurses & bsd curses, more info found here

@gdamore
Copy link
Owner

gdamore commented Dec 4, 2019

I think there are some easy options here -- we'll need to add some new constant values for "ThemeColors" to distinguish them from explicit requests for colors by RGB. This is better than just using a global switch because it can allow an app to honor theme settings for the terminal for most of the window, but require explicit colors in other places. (E.g. a browser app could use the terminal defaults for most things, but use explicit RGB values for images.)

@antonmedv
Copy link

It will be cool to have bold working too.

@gdamore gdamore self-assigned this Aug 25, 2020
@gdamore gdamore added this to the v2 milestone Aug 25, 2020
gdamore added a commit that referenced this issue Aug 26, 2020
This causes colors that are set that are low numbered to
be treated as themed colors -- basically honoring the palette
of the terminal.

The Style and Color implementations have changed quite a bit
to permit growth -- the colors are now 64-bits wide to permit
using the upper bits as flags, and to leave room for a future
alpha channel.

There is a new TrueColor() method on colors that obtains the
value as strict RGB value, and this will be used in lieu of
whatever terminal colors are provided -- giving the application
full control over the color space if they want, without
forcibly clobbering user preferences for terminals for the
vast majority of cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants