-
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
Fixes #219. Adds Underline and Blink #1275
Conversation
jmperricone
commented
Apr 30, 2021
It works with WindowsDriver, CursesDriver and NetDriver(windows). The only thing that seems off to me is that I did not make If someone is using this value assuming it only have color, it would be very bad.NetDriver sets the biggest number. value = ((((int) f) & 0xffff) << 16) | (((int) b) & 0xffff) with ConsoleColor.White = 15
using something like 0x100000 for underline would be possible if I'm not wrong. Tell me what you think. I set this as a draft. |
Good work. Any day we will have the #48 RGB working :-) |
Yes you, can underline words, like you change the color of a word. I just realized that it will only work for windows, when using the netdriver. |
I am pleased for my |
Now that I read this, it seems to me that it is not clear. It works with What I meant is that with the void SetUnderline (bool state)
{
redrawUnderline = state;
if (IsWinPlatform == true) {
var OutputHandle = NetWinVTConsole.GetStdHandle (NetWinVTConsole.STD_OUTPUT_HANDLE);
var success = NetWinVTConsole.GetConsoleScreenBufferInfo (OutputHandle, out var csbi);
if (success) {
if (state == true) {
csbi.wAttributes |= 0x8000;
} else {
csbi.wAttributes &= 0x7FFF;
}
NetWinVTConsole.SetConsoleTextAttribute (OutputHandle, csbi.wAttributes);
}
}
} |
You don't need to use |
But is better to add the underline bitwise to the contents attribute than increase the contents length to save the underline. |
@jmperricone, when you have the time please check my PR jmperricone#1, please. Thanks. |
Hi, thanks for the pull #1 @BDisp About the bitwise underline, I thought about that:
Because public override Attribute GetAttribute ()
{
return currentAttribute;
}
...
public static implicit operator Attribute (int v) => new Attribute (v);
... Then Attribute.Value contains that If that is not a problem, is ok! |
It's okay because if Attribute.Underline is true it's possible to extract from the value. |
Should be that added to the if (attr.Value > 100) {
...
} Having Underline set, will always return true. |
Is true, but the user may check if |
We need to create an Issue for this set to point to the v2 Project (https://github.com/orgs/gui-cs/projects/1) and retarget this PR at the |
This work should be merged into #2612. Closing. |