php-school / cli-menu

🖥 Build beautiful PHP CLI menus. Simple yet Powerful. Expressive DSL.
http://www.phpschool.io
MIT License
1.94k stars 106 forks source link

Auto detect current background #233

Closed mikeerickson closed 4 years ago

mikeerickson commented 4 years ago

Looking for some advise on setting foreground / background colors based on current terminal settings.

Ideally, just do some simple inversion would suffice.

What have you all done under these conditions?

AydinHassan commented 4 years ago

Hey, sorry I’ve never come across this problem so I can’t really help. Did you manage to find any information?

mikeerickson commented 4 years ago

Nope, I could not find a working solution

AydinHassan commented 4 years ago

@mikeerickson If you come up with something in the future, that would be a pretty cool feature!

mikeymike commented 4 years ago

You can set the background and foreground colours, so I think the worst case scenario would be the background is the same as the terminal background.

All scenarios I think are fine as long as you set your background and foreground with enough contrast it should always be readable

(This doesn't of course cover the cases where the user has customised their terminal colours unfortunately)