Open Syntaf opened 8 years ago
I guess one workaround would be to draw the terminal with a specific cell that I can set to some standard color, say Black, then generate colors 1-7. That however would not be as ideal as working with default terminal colors
FWIW on my terminal (gnome-terminal) the background color is a separate color from the 16 "regular" ones.
I may be misunderstanding the issue, but since Color
implements Eq
, you shouldn't need to compare colors by calling as_byte
, simply use the equality operator.
Also, with regards to @bestouff 's point, I have the same situation with my terminal (and I would assume with most other people would too) which is that the terminal background color is not one of the "regular" ones and there really isn't any way to find out what color that is as it's specified in .Xresources
and handled separately.
I'm running into a problem in generating a random color for my program. The problem is that when generating a random color, between 0 and 7, I have no way of ensuring this random color is not actually the terminal background because there is no comparison to Color::Default.
say I generate a random color
Well on a terminal with a black background, 0 cannot be used as it represents black. For a blue background, 4 cannot be used. This could be solved with a trivial comparison to the terminal background color, however there is no current way to do this because Color::Default cannot be compared with.
is there any workaround for this or am I simply out of luck in this situation?