-
Notifications
You must be signed in to change notification settings - Fork 696
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
Colors: Update Color System (TrueColor, Blink, Underline, etc...) for v2 (Master Issue) #457
Comments
That's correct, it is the most recent console driver refactoring branch. Please can you also consider taking/adapting this veeman#2 (
I would really love true color support for so many cool things. Especially for colored icons in FileDialog, gradient borders etc. Let me know if you want to collaborate on this. |
Sure I can give it a try this week. Seems straightforward enough given the pre-existing examples. Is this the right place to loop back if I have any troubles? |
Awesome, this is really exciting!
Sure, post any initial/logistics issues here. When there is a PR (even a draft one) then we can talk about more specifics there. I guess since #2612 is +10,135/−9,977 vs We can always retarget once |
It will likely be a week or so before I can spend time on my console dupe PR, so I concur you should party on it and submit PRs to it for the color stuff. Really excited to see someone picking this up! Thank you! |
Got it running. See tig#15. |
This is a great work. Thanks for providing this. Does it also works on another drivers ( |
Its ok if it only works for console driver to start with. We can always add support in the other drivers after. As long as the fallback mechanism is working and the true color class design is sound. The original work was done by @veeman so it might be we don't have the expertise between us to do the other drivers yet. |
The PR doesn't add support for The PR just enables WindowsDriver to use VT sequences to describe the requested console color. This should work consistently because there's a clear mechanism to detect whether TrueColor support is possible by checking the version of Windows. AFAIK Curses uses a mechanism where, if you aren't using one of the 16 default Console colors, you have to register the color you want to use and get returned an identifier to pass along for future calls. This has some limitation where you can only have a couple thousand cached colors due to some restrictions of Curses. If you want to use VT sequences, when using Curses, you'd need to figure out some other means of detecting whether they'd be supported. |
I think this should be handled with config files in the same way we support Nerd Fonts (#2613). So any end user could add to their "VTTrueColor.Enable": true Or if the vast majority of modern consoles support this we could default it to true and let end users opt out with a setting of false in config. |
@adstep I don't know if you already seen my explanation why some colors has the value -1, in tig#15 (comment). |
@BDisp is it still possible to output specific escape sequences in CursesDriver? I know @tig mentioned reducing/eliminating reliance on ncurses methods in #2612 (comment) in favour of direct use of escape codes (he references #1107) I found and tested some of the console escape codes in the following video on my linux box and found they work. Also sounds like most modern linux terminals are going to support at least 256 if not true color escapes: See this test script that shows how to output escape sequences for 256 colors If the escape codes approach taken in tig#15 would still work in linux then I think we should just be practical about things. Specifically:
Sorry that I am a little late to the party on this as I haven't gotten so deep into all the various schemes etc |
@tznind I really don't know, because the |
Based on my research I believe @tznind is right. I am going to resist trying to do this in my huge pr, so I can get it merged asap, but I'm now convinced we can actually replace BOTH CursesDriver and WindowsDriver with a new "AnsiDriver". |
Oh, and if we do end up keeping support for 16 bit color, it will NOT be the default. Based on what I know now, I want True Color to be default with "as smart as possible" fallback to 256 and/or 16. I worry about performance emitting stuff ourselves. It's easy to make it work, but my intuition is it's also easy to emit way too many sequences potentially causing perf problems. |
#2612 now passes all unit tests - The true color support is fragile though. I'm going to refactor a bunch of it in line with what I said above in next few days. Hopefully I can get it to a point where it's architecturally correct, if not completely working, in the next few days. I then have a few more issues in #2612 to address before it can be merged. |
Proposal:
Once the above is done, I can merge to v2_develop. We can then open PRs to fix/adapt other things:
@BDisp, @tznind, @adstep - let me know if you have more thoughts, questions, or suggestions on all this! |
Did the PR #2729 resolved true color on Linux? |
Well the PR #2729 includes true color for |
Are you sure it does? I peeked at the code briefly and saw no evidence of related changes to CursesDriver. I'll look again later. |
Found this: https://github.com/WilliamRagstad/ANSIConsole Might be useful. |
This is the master Issue for revamping the Color system in v2. Dependencies:
ColorSchemes
refactor - Should honor terminal color settings etc... #2381ColorPicker
for TrueColor #2801ColorPicker
and Color Scenarios in UICatalog #2800See also:
Todos
The text was updated successfully, but these errors were encountered: