-
Notifications
You must be signed in to change notification settings - Fork 608
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
Colored text #9
Comments
+1 on this feature. I made an experimental change in my fork to allow client access to View.fgColor and View.bgColor but this only allows changing the entire view. To implement color as above, is there some strategy or library from extracting the color information from the string "Regular text and [yb:Yellow bold text]"? |
Sorry for the delay kgilmer, but I've been working on other projects (I plan to come back to the gocui development really soon :). Regarding your question, I was thinking on designing some kind of custom-syntax easily parseable using regexp. |
+1 colors per view would be extremely nice and useful. |
There are two nice packages I have come across recently that could come in handy. colorstring was released less than a day ago. Faith's color package is pretty useful, I've used this one recently. |
Hi @jroimartin, just wondering if there was any plan around this one? Would love to use this library over using termbox directly for a project I'm just kicking off. Happy to contribute if you had a high level idea of where you want to go with it. |
Hi Michael, Right now I'm working on giving gocui a real full edition mode. And then I After finishing these two tasks my idea is to implement color support, but In short, my plan is to implement it after finishing the full edition mode |
Hi @jroimartin, the new version sounds good, might be worth waiting until that's done. The benefit of ANSI codes in the input might be because you could still use an The benefit to having a concrete API for triggering colour changes would be user friendliness. It would be interesting to see if it would work having a defined interface, but internally it just generated the appropriate ANSI escape code and sent it to the |
Hello, I would like to know what's the status for this? I would like to use colored text in a project I am working on. I tried ANSI but those are apparently escaped :) Thanks |
It is still a work in progress and, hopefully, I will implement it soon using ANSI codes to specify the colours. |
I've implemented basic support for ANSI escape characters in #39 |
@deweerdt cool! Color support is the number one priority for v0.3. I'll give it a look in the next days :) |
@jroimartin I've noticed some issues yesterday with the current patch: attributes don't survive a line change. I'll post an updated version this week. |
Ok, I've added the fix to PR #39 |
Merged! |
Added contributors guide
Add support for colored text. E.g.: fmt.Println(v, "Regular text and [yb:Yellow bold text]")
The text was updated successfully, but these errors were encountered: