KristofferC / Crayons.jl

Colored and styled strings for terminals.
Other
150 stars 14 forks source link

Allow using Crayon outside print statements #65

Open JTaets opened 1 year ago

JTaets commented 1 year ago

AFAIK, you need to be using print to get strings with multiple styles. Something like the following doesn't work:

@assert false "This is an " * Crayon(foreground=:red)("error")

This throws an error:

 no method matching *(::String, ::Crayons.CrayonWrapper)
JTaets commented 1 year ago

Something like this works though

@assert false "This is an $(Crayon(foreground=:red)("error"))"