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

Question: Does it make sense to support outputting arbitrary colors? #42

Open
ldionne opened this issue Dec 11, 2016 · 4 comments
Open

Comments

@ldionne
Copy link

ldionne commented Dec 11, 2016

Would it make sense to allow outputting arbitrary colors specified by a hex color code? I'm not sure whether that can even be implemented (i.e. whether terminals even support it), so this is more a question than a feature request at this point.

@agauniyal
Copy link
Owner

@ldionne yes it is possible but not with the current code. But again not a lot of code will change for its implementation since much of the code is common. Another function which takes hex as args will do but will have to be tested on lots and lots of terminals again.

Here is the community-maintained list of terminals for such feature - https://gist.github.com/XVilka/8346728

The problem is not every vt100 family terminal supports such feature, but if there's demand I can work on same. And I'm willing to accept PRs for the same too 😄

@ldionne
Copy link
Author

ldionne commented Dec 11, 2016

Thanks for the answer.

Don't consider this a feature request; I just wanted to know if it made sense, and if so bring it to your attention because it's an obvious generalization of being able to output predefined colors only.

@ldionne ldionne closed this as completed Dec 11, 2016
@agauniyal
Copy link
Owner

I'll work on a separate function under the same namespace and test it on a few machines in next few days. If everything works out, I'll release a newer version of rang with said feature.

@agauniyal agauniyal reopened this Dec 12, 2016
@agauniyal agauniyal added this to the Release 3.0 milestone Dec 20, 2016
@agauniyal
Copy link
Owner

agauniyal commented Dec 24, 2016

@ldionne So I've tested a prototype that supports both 256 colors and 24 bit truecolor(rgb mode) but the problem that remains is - there is no way to test if a terminal emulator supports it or not. Some of them do, but we still cannot hardcode them with $TERM or termcap/terminfo because they managed to support it after certain version which they might or might not expose via env variables. Though windows 10 support is quite good 👌

tldr; it works but there is no way to know if certain terminal supports it or not, windows 10 works.

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

No branches or pull requests

2 participants