Coloring your console prints
Since Elixir 1.4.0 we have ANSI color printing option.
Ir supports also background colors.
For more information, see: https://hexdocs.pm/elixir/IO.ANSI.html
Examples
import IO.ANSI
IO.puts red <> "red" <> green <> " green" <> yellow <> " yellow" <> reset <> " normal"
IO.puts Enum.join [red, "red", green, " green", yellow, " yellow", reset, " normal"]
IO.puts IO.ANSI.format([:blue_background, "Example"])
IO.puts IO.ANSI.format([:green_background, "Example"])
I appreciate everyone who has read through here, if you guys have anything to add, please leave a comment.
Top comments (0)