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
New feature : List - color per line #4
Comments
Hi @yesnault , this will be a useful feature! I think we can put it this way: data = []string{
"1. pass: foobar0",
"[[color=red]]2. warning: foobar1",
"3. pass: foobar2"} If one wants to specify a particular color, insert a piece like |
LGTM !
|
I don't know if it's possible or better, but another solution is to use same syntax than term color, like that for yellow color
|
@yesnault I like your solution, since it looks more "natural" in the sense of terminal printing:) |
Another option I've seen is to use HTML style syntax e.g.
This is nice as it lets you color individual parts of a line. |
That seems pretty good, but have to type up many chars. How about this: item := "[ERROR](red,bold) Something went wrong" Does the same thing but uses markdown-like syntax. |
+1 |
Has anyone already started working on it? If not, I could start in a few days. |
👍 That would be great! I was also thinking maybe we can apply this for any text rendering not just List. Introduced a new struct text.Len() int // return string real length
text.Buffer() []Point// return Points
text.SetBg(Attribute)
text.SetFg(Attribute) Then all text procedures can use this structure to render, which gives the ability of using specific color. |
👍 |
While something like that was my initial idea, it is not going to work because of text overflows. This should not break backwards compatibility and it will be customizable so that @warmans can implement his html formating if he wants to. Sent from my iPhone
|
+1 for markdown syntax: it's easy to pick up even if you're terminal codes guy. |
👍 |
Done! |
Thanks to everyone ! |
Hi,
It would be nice to be able to define a line (per line) color in the widget list.
Thks !
The text was updated successfully, but these errors were encountered: