pillar
pillar copied to clipboard
Theming
Specify color (foreground and background) for:
- subtle style (perhaps in the
gray##syntax) - rowid style
- negative numbers
NA- groups of three digits
Could be implemented as a separate option for each color, and/or as two sets of options, one for light, one for dark backgrounds.
Would the bold/italic font styles for table headers fall into this as well?
We'd need to think how to encode this in options. Maybe we could support formatter functions as options?
@s-fleck: What would be a good way for pillar to make use of colt's themes?
colt is just a thin wrapper around crayon. So instead of crayon::red() you would use colt::clt_chr_accent(). colt::clt_chr_accent() then applies whatever function is defined in the currently active colt theme (in this case getOption("colt.theme")$clt_chr_accent()) . A colt theme is just list of functions with predefined element names.
When I decided on which theme-elments go in colt, I tried to orient myself after existing packages (mostly tidyverse and what I needed for my packages). For example, there is already colt::clt_chr_subtle() which is inspired by pillar:::style_subtle().
When this is implemented, there needs to be a default theme like plr_theme.classic which prints tibbles in their original format. The more I use the latest version of tibble with the pillar formatting the more frustrated I become. I can NEVER seem to get the output of a tibble to look right now. I just really REALLY want to remove all of the extra formatting that pillar is doing. NO BOLD/ITALIC. NO ARTIFICIAL HIGHLIGHTING. NO ARTIFICIAL CHOICES OF FORCING EVERY COLUMN TO BE THE SAME WIDTH/HAVE THE SAMER DIGITS. Just print the column types as base-R would. I have lost so much productivity fighting with this over the last week it's ridiculous.
@dpeterson71 colt does not support by-package color themes, but its easy to disable colors for all packages that use colt (well, right now there is only one on CRAN, but in theory ;) )
I also agree that while I find the formatting of pillar useful if you deal with large doubles, it makes most of my tables look weird. For example I often have a "year" column in my data, where the last digit (the most important one in this case) is grayed out by default. Also the bold column headings seem to mess formatting up on my work computer.
@krlmlr cant wait for this theming option!
Totally agree with @dpeterson71 . Default should be ol good black 'n gray tibbles with no formatting. As discussed in other threads there are some formatting choices which are quite controversial and even dangerous for the uninformed user.
Then, more advanced users can have fun with the other themes available, with full knowledge of what they are signing for.
Thanks again!!!
tibbles, tibbles everywhere

Please add a way to turn off the underline of groups of three.
@dpeterson71 This is a bit late, but set the NO_COLOR env var to true and then all formatting is removed.