Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
JoshTriplett
47 days ago
|
parent
|
context
|
favorite
| on:
How to choose colors for your CLI applications (20...
CLI apps can detect the background color of the terminal, and determine contrasting colors accordingly.
takluyver
47 days ago
[–]
They can? Is this a recent thing? I remember wanting to detect the background colour years ago, and not finding any way to do it.
JoshTriplett
47 days ago
|
parent
[–]
It's not recent, and most terminals support it. You send an escape sequence to the terminal, and get back a sequence that tells you the exact background color.
takluyver
47 days ago
|
root
|
parent
[–]
Huh, indeed. I still can't find much information about this, but this page is very informative:
https://jwodder.github.io/kbits/posts/term-fgbg/
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: