-
Notifications
You must be signed in to change notification settings - Fork 1.3k
colors: Add blink, dim and strikethrough to the colorscheme attributes
#4126
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,19 +23,23 @@ func TestAttributeStringToStyle(t *testing.T) { | |
|
|
||
| assert.Equal(t, tcell.ColorTeal, fg) | ||
| assert.Equal(t, tcell.ColorAqua, bg) | ||
| assert.NotEqual(t, 0, attr&tcell.AttrBold) | ||
| assert.Equal(t, tcell.AttrBold, attr&tcell.AttrBold) | ||
| } | ||
|
|
||
| func TestMultiAttributesStringToStyle(t *testing.T) { | ||
| s := StringToStyle("bold italic underline cyan,brightcyan") | ||
| s := StringToStyle("bold blink dim italic reverse strikethrough underline cyan,brightcyan") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I remove
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nothing, but you uncovered a type "conflict" which doesn't fail on negative evaluation. We have two options:
|
||
|
|
||
| fg, bg, attr := s.Decompose() | ||
|
|
||
| assert.Equal(t, tcell.ColorTeal, fg) | ||
| assert.Equal(t, tcell.ColorAqua, bg) | ||
| assert.NotEqual(t, 0, attr&tcell.AttrBold) | ||
| assert.NotEqual(t, 0, attr&tcell.AttrItalic) | ||
| assert.NotEqual(t, 0, attr&tcell.AttrUnderline) | ||
| assert.Equal(t, tcell.AttrBold, attr&tcell.AttrBold) | ||
| assert.Equal(t, tcell.AttrBlink, attr&tcell.AttrBlink) | ||
| assert.Equal(t, tcell.AttrDim, attr&tcell.AttrDim) | ||
| assert.Equal(t, tcell.AttrItalic, attr&tcell.AttrItalic) | ||
| assert.Equal(t, tcell.AttrReverse, attr&tcell.AttrReverse) | ||
| assert.Equal(t, tcell.AttrStrikeThrough, attr&tcell.AttrStrikeThrough) | ||
| assert.Equal(t, tcell.AttrUnderline, attr&tcell.AttrUnderline) | ||
| } | ||
|
|
||
| func TestColor256StringToStyle(t *testing.T) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're at it:
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, why not this as well?