Closed Nevrage closed 6 years ago
I could implement support for this, but what terminal emulator really display RGB colors? I have just tested xterm on Ubuntu 17.10 and the terminal outputs the closest ANSI color:
cat("\x1b[38;2;255;0;0mTRUECOLOR\x1b[0m\n")
cat("\x1b[38;2;255;20;0mTRUECOLOR\x1b[0m\n")
cat("\x1b[38;2;255;40;0mTRUECOLOR\x1b[0m\n")
cat("\x1b[38;2;255;60;0mTRUECOLOR\x1b[0m\n")
cat("\x1b[38;2;255;80;0mTRUECOLOR\x1b[0m\n")
cat("\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n")
Anyway, the simplest way of support this would be to accept strings as color definitions. Then, it would be up to the user to define the color correctly.
I don't know much about terminals bit I thought URxvt supported RGB colours.
Though I think I'm being confusing, my only issue is that on certain terminals my R output is not colored by the values in my Xresources file or by the theme of the terminal
colorout
does not read Xresources. Please, do this in R:
library(colorout)
?setOutputColors256
Yes I have read the documentation.
I was just wondering if there was a way to have colorout at least pick the closest color.
So that changing the Xresources would change the colors in colorout
.
I am sorry, but I am not going to support Xresources. But I am working to let you pass any arbitrary string as color code.
Of course, that's perfect, I'll have something in my Rprofile to parse the Xresources.
Thank you very much!
I am going to commit the change. Please, update the package, see the example of ?setOutputColors
and reopen the issue if anything goes wrong.
@Nevrage: If you come up with some Xresourses parsing code that works with the new colorout code, maybe you could share it here (as a gist?) for others that try to achieve the same and land here by search?
@Nevrage I cannot replicate the background leaking issue.
What setOutputColors256()
would replicate your color scheme?
Can you replicate the issue in other terminal emulators?
I tried iTerm2 and never was able to reproduce it. Starting fresh with a simpler .Xresources seem to have fixed it on URxvt. I'll write an issue if I ever find the setting that broke it.
I maybe be wrong but it seems we can only use pre defined colours from the
colors()
list. Would it be possible to use user defined colours based on RGB values instead ?