tabled
tabled copied to clipboard
Add `Theme` support
The idea to have a text and border style which might be called Theme
.
So it could look something like this.
Seen https://github.com/jedib0t/go-pretty/blob/main/table/images/table-StyleColoredBright.png
The implementation would require some color library which would require adding a new feature flag.
I'd like to note that the look like this is must be working already, but it must be set by the user by manual changes in cell content and cell borders.
The theme could be responsible for a layout of a table, e.g #130 .
The implementation I have in mind is to have a ThemeBuilder
which would be responsible for the layout and for text formatting.
Though now it gets interesting because we have IndexBuilder
whose build
method returns Table
so ThemeBuilder
and IndexBuilder
won't able to be called at the same time.
Also a note that we have a default style Style::default
.
If ThemeBuilder
is used it must be responsible for the style.
If it will be merged some-when we probably need to put some important message to Format
type that it should be used with caution.
Of we would better have a ThemeBuilder
and LayoutBuilder
?
We could create colorization
as a different structure.
table.with(Colorization::new(color1, color2).pattern(ColorizationPattern::Chess))
enum ColorizationPattern {
Columns,
Rows,
Chess,
}
Done by Colorization
.
Though the idea of themes still valid; there's more things we could do with this for example as Layout
.