Skip to content
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

Add support FullColor (24bit) for Windows #103

Closed
wants to merge 5 commits into from

Conversation

prifio
Copy link

@prifio prifio commented Jun 9, 2018

I add api for support 24bit color and 8bit color(256 color). Change struct Attribute to class Attribute and add class FullAttibute : Attribute. Add FullColor class (just r-g-b) and static method to convert 24bit color ←→ 8bit color (Linux-like) ←→ 4bit color (Old-windows-like).
Change WindowsDriver implementation for support 24bit color.
But i can't implement checking windows version (old verson don't support 24bit color). I tried to use registry, but .Net Core don't support it. (see SetSupportFullColor() in WindowsConsole)
Change background of Box10x in example.
image

Add FullColor class. Add GetCode(color) and GetColor(code) methods. Add
FullAttribute
Add WriteConsole form kernel32. Add FullWriteConsole. Change
OutputBuffer in WindowsDriver. Change WriteToConsole (work in 4bit and
24bit situatoin) SetSupportFullColor DON'T IMPLEMENT
Add FullColor element to example. Fix setAttribute
@migueldeicaza
Copy link
Collaborator

Thanks for the contribution! I am currently on vacation, with limited time to review, but I think this looks good.

I will take some code, but I suspect that this might force me to finally revisit the color allocation code, and come up with something better.

Change FullColor to TrueColor. Change Windwos and Linux code to code4
and code8. Expand Attribute, remove FullAtribute. Back to struct
Attibute. Add ConsoleModes (remove "| 7"). Fix cursor position after
WriteConsole. Implement SetSupportTrueColor. Fix small tab
@prifio
Copy link
Author

prifio commented Jun 15, 2018

I rewrote some part of code. I removed FullAttribute and back to struct Attibute and expanded Attribute (it's strange, but I more time didn't see easy way). Refactored code, restored cursor position after ConsoleWrite. And I tried implement TrueColor support detection. System.Runtime.InteropServices.RuntimeInformation.OSDescription Work fine (unlike System.Environment.OSVersion), but CI server can't build bkz he can't find this property.

@@ -10,6 +10,7 @@
using Mono.Terminal;
using NStack;
using Unix.Terminal;
using System.Drawing;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System.Drawing will be problematic, I would rather avoid bringing another assembly dependency.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. I forgot remove it. Now, System.Drawing not used

@migueldeicaza
Copy link
Collaborator

This looks great. I will check after this 0.16 bug fix releease

@tig
Copy link
Collaborator

tig commented May 22, 2020

Is this a PR that we should take? Is this still valid?

@tig
Copy link
Collaborator

tig commented Jun 4, 2020

@migueldeicaza - please comment on this PR. Should we pursue it or abandon?

@tig
Copy link
Collaborator

tig commented Jul 15, 2020

I'm closing this PR as it is quite stale.

@tig tig closed this Jul 15, 2020
@AndreR
Copy link

AndreR commented Nov 30, 2020

Pretty sad, that this was abandoned!

@tig
Copy link
Collaborator

tig commented Nov 30, 2020

I agree. It would be awesome if someone took it on. The tracking issue is here: #48

@AndreR
Copy link

AndreR commented Dec 1, 2020

@tig What do you think? How complicated would it be to re-implement this pull request into the current state of development?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants