bifurcationkit / BifurcationKit.jl

A Julia package to perform Bifurcation Analysis
https://bifurcationkit.github.io/BifurcationKitDocs.jl/stable
Other
303 stars 37 forks source link

Replace hardcoded ANSI colors with `printstyled` #133

Closed danielwe closed 10 months ago

danielwe commented 10 months ago

Hardcoded ANSI colors produce garbled output with IOContexts that don't support terminal colors. One example is Pluto; see the following screenshot:

Pluto output with color codes

This PR rewrites the affected @printf statements to use printstyled instead, which respects the attributes of the IOContext. With this change, the Pluto screenshot looks like this:

Pluto output with `printstyled`

I made sure the step column still lines up:

`step` lines up

For terminals that support it, colors and boldness are the same as before:

terminal output with colors

rveltz commented 10 months ago

cool! thank you