Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Color messages #59
Love this package.
Not sure whether coloring messages is something you'd be interested in adding, but if so, here's a small PR. I left warnings and strings as they are, so this only applies to
This doesn't currently take advantage of everything
We could also add more error handling for bad colors, though the current error is decently informative:
did you try yet? does it work or not work?
you mean for the quote bubble thing and they animal/thing?
right, i think that error is probably good enough
It does work for warnings now that the
As for strings, it attaches the color encoding to the string, like
which I guess could be helpful.
Yeah, exactly. So arguments would be like
Looks good on the warning and string output.
For failure behavior, how about adding an assertion that
say(color = 5) #> Error in crayon::make_style(color) : #> is.character(style) && length(style) == 1 || is_rgb_matrix(style) && .... is not TRUE
which isn't especially useful.
right. not sure how to change that. if you have any ideas go for it.
Okay so the two color thing is a bit more complicated
I know pretty much nothing about how coloring strings works this but it looks like the code at the beginning of a string applies to the rest of the string until it hits an escape sequence.
If you run
That as a string is
What we want is the
It looks like we can resume the
I'd need to look more into what
Alright it's maybe a bit hacky, but two colors should work now.
If any animals/things are added that don't follow the usual pattern we might want to go to
I'm not totally sure why the string matching test is failing on Travis. Passes for me locally ¯\(ツ)/¯
yeah I truly have no idea why
so instead of
we could do something like this
or maybe I'm not hip enough to the memes and that's against the whole idea of the hypnotoad?
ah good point. the only thing that I can see that would prevent
totally, will open a new PR for the hypnotoad if @richfitz is on board