-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
Want ColorNone to preserve existing color(s) #606
Comments
@StephanieSunshine The closest you can do is a call to GetContent followed by SetContent: _, _, style, _ := screen.GetContent(x,y)
screen.SetContent(...) It looks like a tcell.Inherit color definition would be possible, since the Color type has a lot of extra bits available for flags. |
As @rockorager says, you can retrieve the current style and modify it yourself. There is no convenience method for this. But maybe we can add something. I'm looking at ways to apply some style changes (specifically colors for now) to regions at a time. One can imagine a SetRegionForeground, SetRegionBackground, etc. This will probably be better for most use cases anyway. |
Please see #579. That's about lines, but if this could be on a region, and you could use StyleDefault with either just the foreground or the background (or for that matter just attributes), would that solve the need? |
If it would, let's close this as a duplicate of #579. |
Actually, I've decided to have ColorNone for this purpose, and to use this ticket for it. |
While here, consolidate the use of the Fill() function from CellBuffer (eliminating redundant code).
Is it possible to tell SetContent via a special flag to use whatever the existing background color is at a location automatically with whatever foreground is set in the style. Example:
The text was updated successfully, but these errors were encountered: