# Colouring the output of println

**URL:** <https://discourse.julialang.org/t/colouring-the-output-of-println/42136>\
**Category:** General Usage\
**Tags:** question, package\
**Created:** [June 26, 2020, 10:41pm UTC](https://discourse.julialang.org/t/colouring-the-output-of-println/42136 "2020-06-26T22:41:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fusion809](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fusion809/32/6080_2.png) [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Post date:** [June 26, 2020, 10:41pm UTC](https://discourse.julialang.org/t/colouring-the-output-of-println/42136/1 "2020-06-26T22:41:33Z")

</div>

My new package’s tests include println lines to explain the tests being run so that their output is more helpful. It would be nice to be able to distinguish println line outputs from the other outputs using colour coding. Is there a way to colour the output of println? The only relevant result from running a DuckDuckGo search for: “println colour output julia” was [Printf · The Julia Language](https://docs.julialang.org/en/v1/stdlib/Printf/index.html) and it doesn’t mention any colouring options. Nor does `?println`. So I suspect there’s no in-built option to colour the output, I’m just hoping someone has a workaround.

---

<div class="post-metadata">

**Author:** ![Bigorneau](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@Bigorneau](https://discourse.julialang.org/u/Bigorneau)\
**Post date:** [June 26, 2020, 11:54pm UTC](https://discourse.julialang.org/t/colouring-the-output-of-println/42136/2 "2020-06-26T23:54:38Z")

</div>

In Base there is the function `printstyled([io], xs...; bold::Bool=false, color::Union{Symbol,Int}=:normal)`, note that you will need to add “\n” to match `println` behaviour. E.g.

```julia
printstyled("Hello\n"; color = :blue)

```

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [June 27, 2020, 7:26am UTC](https://discourse.julialang.org/t/colouring-the-output-of-println/42136/3 "2020-06-27T07:26:34Z")

</div>

There is also

[https://github.com/KristofferC/Crayons.jl](https://github.com/KristofferC/Crayons.jl)
