# Invisible fonts in DataFrame.display() with solarized dark theme in Terminal

**URL:** <https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804>\
**Category:** Tooling\
**Tags:** repl, colors, dataframes\
**Created:** [August 4, 2021, 1:00pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804 "2021-08-04T13:00:47Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![RTbecard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rtbecard/32/26677_2.png) [@RTbecard](https://discourse.julialang.org/u/RTbecard)\
**Post date:** [August 4, 2021, 1:00pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/1 "2021-08-04T13:00:48Z")

</div>

When I show a `DataFrame` object in the REPL, under each row its supposed to list the Type for each series.

```julia
using DataFrames
DataFrame(((1,2,3), (4,5,6)))

```

However, in my terminal, the font color for the Types is the same as the background, making them effectively invisible. I know the values are there, as when I highlight the text, the color inversion makes them visible. See attached screenshot.

![1](https://global.discourse-cdn.com/julialang/original/3X/c/1/c12242894e1c87c3f771f82947439a7f0831f417.jpeg) ![2](https://global.discourse-cdn.com/julialang/original/3X/0/9/09c1bf6db551fcea1d262347bacc4010be9a1dac.jpeg)

This is pretty problematic for me, since my IDE is terminal based (nvim) and I’m far too in love with solarized dark to switch to some other color scheme.

Has anyone else dealt with this issue? Since solarized-dark is a pretty common theme, I’m tempted to raise this as an issue in `DataFrames.jl` package. Should I report this to `DataFrames.jl`, or is there maybe some other reason for this behaviour?

This happens when I’m running the REPL in the terminal by itself, and also when I use an embedded terminal in nvim.

[edit: I’ll mention I’m on PopOS 21.04, using Tilix… in case others with different terminals/IDEs aren’t running into this issue.]

---

<div class="post-metadata">

**Author:** ![gbaraldi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gbaraldi/32/22101_2.png) [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)\
**Post date:** [August 4, 2021, 1:13pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/2 "2021-08-04T13:13:45Z")

</div>

Open an issue in DataFrames.jl , and if it’s necessary you will be directed to the right place.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [August 4, 2021, 1:17pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/3 "2021-08-04T13:17:22Z")

</div>

DataFrames relies on PrettyTables for printing, so I think it’s probably an issue for there.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [August 4, 2021, 1:57pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/4 "2021-08-04T13:57:19Z")

</div>

It can be reported either in DataFrames.jl or PrettyTables.jl, anyway I will ask @Ronis_BR to kindly have look at it :).

However, note that we use dark gray color here. So this is a standard color picked from a set of 16 standard terminal colors. Personally (but it is subjective), I would say that color theme you use should show such a color legibly (what I want to say is that we are not using some fancy and strange color - it is a basic color that normally should be displayed in a legible way). How hard would be to fix your color scheme to display dark gray in a legible way?

B.t.w. how is this table displayed in your terminal?:

```julia
julia> DataFrame(x=[missing, DataFrame(x=1)])
2×1 DataFrame
 Row │ x
     │ DataFrame?
─────┼───────────────
   1 │ missing
   2 │ 1×1 DataFrame

```

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [August 4, 2021, 2:00pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/5 "2021-08-04T14:00:57Z")

</div>

It’s known that Solarized’s `light_black` color is broken (i.e. the same as the default background color). I’m still inclined to tell people to fix their themes so that devs can use all colors fine…

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [August 4, 2021, 2:11pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/6 "2021-08-04T14:11:29Z")

</div>

I think the problem is with the theme itself. PrettyTables.jl uses, by default, the color `dark_gray` when printing the subheader (the type in case of DataFrames.jl). I am not sure what we can do here because your theme is apparently using `dark_gray` as the background also. You have two options, the first one is to disable colors at all by starting Julia with `--color=no`. The second is to show DataFrames.jl using the option `subheader_crayon`. Something like this:

```julia
julia> show(df, subheader_crayon = DataFrames.crayon"white")

```

---

<div class="post-metadata">

**Author:** ![RTbecard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rtbecard/32/26677_2.png) [@RTbecard](https://discourse.julialang.org/u/RTbecard)\
**Post date:** [August 4, 2021, 2:11pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/7 "2021-08-04T14:11:43Z")

</div>

@pfitzseb good to know. I had no idea solarized dark had issues… it’s a default theme in gnome terminal (on Ubuntu), so I was trusting that it was a safe choice 😕

@bkamins Solarized is truly aweful in your example.  
 ![3](https://global.discourse-cdn.com/julialang/original/3X/d/2/d243d83f7ed749cb84d6471fdd0988bd316113ae.jpeg)

Ya, so its clear this is a solarized issue. Its trivial for me to change the values for that one color to get around the issue, so I can work around this.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [August 4, 2021, 2:13pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/8 "2021-08-04T14:13:42Z")

</div>

The very first version of PrettyTables.jl integration with DataFrames.jl used a global state to configure default options when printing. Unfortunately, it added a huge amount of time to print the first table. I heard that things got much better in Julia 1.7. Maybe we can revisit this to help this kind of issue. What do you think @bkamins ?

@pfitzseb thanks for the info! I just realized that `dark_gray` and `light_black` are supposed to be the same 😃

---

<div class="post-metadata">

**Author:** ![RTbecard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rtbecard/32/26677_2.png) [@RTbecard](https://discourse.julialang.org/u/RTbecard)\
**Post date:** [August 4, 2021, 2:20pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/9 "2021-08-04T14:20:03Z")

</div>

The workaround was really effortless on my end. I just changed that single color value to a lighter tone in my terminal, and all is legible and fine now.

 ![4](https://global.discourse-cdn.com/julialang/original/3X/a/2/a2c02729307cae6e6fd06f7c98ef8b416d01a3ae.jpeg)

Thanks all for the input, and for enlightening me about this silly palette choice in my much loved solarized them 🙂 .

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [August 4, 2021, 2:24pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/10 "2021-08-04T14:24:55Z")

</div>

Awesome @RTbecard ! Feel free to ping me if you have any other question related to this printing system.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [August 4, 2021, 2:57pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/11 "2021-08-04T14:57:22Z")

</div>

> [@Ronis\_BR](#):
>
> Maybe we can revisit this to help this kind of issue. What do you think @bkamins ?

The question is if you can make [https://github.com/JuliaData/DataFrames.jl/blob/2b9f6673547259bab9fb3bf3b5224eebc7b11ecd/src/abstractdataframe/prettytables.jl#L28](https://github.com/JuliaData/DataFrames.jl/blob/2b9f6673547259bab9fb3bf3b5224eebc7b11ecd/src/abstractdataframe/prettytables.jl#L28) a `mutable struct` (and if doing so would have performance impact). Then we could allow users to tweak it at run time.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [August 4, 2021, 3:04pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/12 "2021-08-04T15:04:20Z")

</div>

> [@bkamins](#):
>
> The question is if you can make [DataFrames.jl/prettytables.jl at 2b9f6673547259bab9fb3bf3b5224eebc7b11ecd · JuliaData/DataFrames.jl · GitHub](https://github.com/JuliaData/DataFrames.jl/blob/2b9f6673547259bab9fb3bf3b5224eebc7b11ecd/src/abstractdataframe/prettytables.jl#L28) a `mutable struct` (and if doing so would have performance impact). Then we could allow users to tweak it at run time.

There is two problem. The first one is that you mentioned, which highlights the `missing` and `nothing`. The second is the keyword argument `subheader_crayon` that is passed to `pretty_tables`. In this case, we will need a global variable to store the default options and let the user change them. PrettyTables.jl already have this mechanism of printing with pre-defined, global options (see `@pt_conf`). However, it leads to a HUGE degradation in time to print the first table. Last time I checked, I can print a `rand(2,2)` the first time in less than 1s. If I use the global options, then it increases to more than 4s.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [August 4, 2021, 3:32pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/13 "2021-08-04T15:32:08Z")

</div>

If you think it is worth it I think you can open an issue in DataFrames.jl to track it and discuss if this is needed. However, I think it is a low priority. A priority should be to have sensible defaults that work well.

---

<div class="post-metadata">

**Author:** ![Skoffer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skoffer/32/378_2.png) [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Post date:** [August 4, 2021, 6:01pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/14 "2021-08-04T18:01:09Z")

</div>

`light_black` can be changed to `light_green`, since it is ok in other colorschemes and gives nice gray color in solarized.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [August 4, 2021, 9:23pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/15 "2021-08-04T21:23:21Z")

</div>

> [@Skoffer](#):
>
> `light_black` can be changed to `light_green` , since it is ok in other colorschemes and gives nice gray color in solarized.

I really did not like this here (black background). It does not make sense to change the default inside PrettyTables.jl since it was design to be easily changed. We can indeed change the default in DataFrames.jl. However, @bkamins must approve that. My personal opinion is that it is not good to change the behavior for everyone because of one theme. The new version does not look good IMHO:

 ![Captura de Tela 2021-08-04 às 18.22.11](https://global.discourse-cdn.com/julialang/original/3X/4/d/4de97e74b07fcc5db2f53da97203334426b2c40a.png)

I think it adds too much contrast to an information that is not the principal.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [August 4, 2021, 9:34pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/16 "2021-08-04T21:34:31Z")

</div>

> [@Ronis\_BR](#):
>
> I think it adds too much contrast to an information that is not the principal.

Exactly - dark gray was selected exactly to get the opposite. The information should be less not more visible (of course still visible).

---

<div class="post-metadata">

**Author:** ![RTbecard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rtbecard/32/26677_2.png) [@RTbecard](https://discourse.julialang.org/u/RTbecard)\
**Post date:** [August 5, 2021, 10:43am UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/17 "2021-08-05T10:43:56Z")

</div>

After a bit more digging, it seems that `solarized-dark` caused more issues in Julia’s REPL I wasn’t aware of.

Parts of the stack traces were also invisible (line numbers)… 😕

See below for more extended discussions on the limitations of solarized.

> [@Solarized Dark theme with 1.6.0](https://discourse.julialang.org/t/solarized-dark-theme-with-1-6-0/57941):
>
> If you noticed like me that some messages are invisible during precompilation with 1.6 when using the Solarized Dark theme in Linux you need to change some of the colors. @dave.f.kleinschmidt proposed the following change to the solarized palette: Change color8 (formerly #002b36) to #657b83

> <https://github.com/altercation/solarized/issues/220>
>
> !\[color\](http://i.imgur.com/8wsMl.png)
> 
> That's how it looks in my terminal, can …read the text only after highlighting them! 
> 
> The color of the text is gray!

---

<div class="post-metadata">

**Author:** ![Skoffer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skoffer/32/378_2.png) [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Post date:** [August 5, 2021, 1:21pm UTC](https://discourse.julialang.org/t/invisible-fonts-in-dataframe-display-with-solarized-dark-theme-in-terminal/65804/18 "2021-08-05T13:21:37Z")

</div>

Yes, this is known bug ([https://github.com/JuliaLang/julia/issues/38730](https://github.com/JuliaLang/julia/issues/38730)), current solution is to redefine `Base.text_color` at `startup.jl`:

```julia
Base.text_colors[:light_black] = Base.text_colors[:light_green]

```

Unfortunately, solarized theme is considered to be part of the “lowest common denominator”, so this state of things is going to stay for a long time (probably forever).

With regard to DataFrame, there is an alternative solution, as discussed in [https://github.com/JuliaData/DataFrames.jl/issues/2831](https://github.com/JuliaData/DataFrames.jl/issues/2831)

You can add following lines in each script, where you are using DataFrames.jl

```julia
using DataFrames, Crayons

Base.display(df::AbstractDataFrame) = show(df, header_crayon = crayon"light_green")

```

This is piracy, but this is piracy for the greater cause, so it is fine.
