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

DarkGray access on Windows/Powershell? #363

Closed
ymyke opened this issue Jan 3, 2023 · 7 comments
Closed

DarkGray access on Windows/Powershell? #363

ymyke opened this issue Jan 3, 2023 · 7 comments
Assignees
Labels

Comments

@ymyke
Copy link

ymyke commented Jan 3, 2023

When I run this script in my Powershell: https://stackoverflow.com/questions/20541456/list-of-all-colors-available-for-powershell
I can see there is a DarkGray color in my system.

However, asciimatics doesn't have that in the Screen class (or anywhere else according to my search). Is there any way to access DarkGray somehow?

(Incidentally, do you know a shell that supports more colors than Powershell on Windows? Or is the limitation underlying?)

@ymyke
Copy link
Author

ymyke commented Jan 3, 2023

BTW, the script mentioned in the SO post lists many other colors, but they are identical to some of the colors that are already supported in asciimatics. At least in my case. That's why I don't mention them. DarkGray is the only one that would add something new.

@peterbrittain peterbrittain self-assigned this Jan 3, 2023
@peterbrittain
Copy link
Owner

There are 16 basic colours in the classic windows console, being split into dark and light variants of the 8 standard (red, green, yellow, blue, magenta, cyan, black and white). Dark white (i.e colour 7 if you use zero indexed counting in C) and light black (i.e. colour 8) make the shades of grey.

In the win32 world, you get the lighter versions by specifying a foreground or background intensity. This broadly maps to the use of A_BOLD in asciimatics. Unfortunately, that only works for foreground colours ascthere isn't a cross platform way of setting background attributes.

@peterbrittain
Copy link
Owner

There have been recent changes to the Wimdows console to support more than 16 colours. This requires a different use of the console API as tracked by #197.

@ymyke
Copy link
Author

ymyke commented Jan 3, 2023

Super, thanks for the hint w/ A_BOLD.

#197 is still work in progress, do I understand correctly?

@peterbrittain
Copy link
Owner

It's a possible future enhancement. I'm not currently working on it.

A simpler enhancement to get access to all 16 background colours (if that's what you need) on Windows would be just to make thwe Windows Screen understand all 16 system colours, i.e. add definitions for all the intense colours and give them new colour constants (e.g. COLOUR_BRIGHT_RED).

Interested in making that change (with a little help)?

@ymyke
Copy link
Author

ymyke commented Jan 4, 2023

I was looking for the dark gray fg color which was not accessible to me. I'm happy with that for the moment.

But I'll get back if things should change.

BTW, I'm ending up using asciimatics in a very raw/direct (and probably unsupported) way for what I'm building. Might contribute with a sample on how to do that if that sounds interesting.

@peterbrittain
Copy link
Owner

I'm always interested in how other people use this project... Feel free to reach out when you have something.

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

No branches or pull requests

2 participants