Skip to content

Commit

Permalink
Document color serialization breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
cruessler committed May 22, 2024
1 parent 659ee74 commit 474bb78
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
* support overriding `build_date` for [reproducible builds](https://reproducible-builds.org/) [[@bmwiedemann](https://github.com/bmwiedemann)] ([#2202](https://github.com/extrawurst/gitui/pull/2202))

### Breaking Change
* Do you use a custom theme?

The way colors get serialized has changed ([see docs](https://github.com/extrawurst/gitui/blob/master/THEMES.md) for more info):

* The format of `theme.ron` has changed: colors are now serialized to strings instead of bare enum variants. This is due to a change in `ratatui`, the underlying library that determines how we serialize strings. See <https://github.com/ratatui-org/ratatui/commit/0a164965ea2b163433871717cee4fd774a23ee5a>.

## [0.26.0+1] - 2024-04-14

**0.26.1**
Expand Down
17 changes: 14 additions & 3 deletions THEMES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The file uses the [Ron format](https://github.com/ron-rs/ron) and is located at

Alternatively, you can create a theme in the same directory mentioned above and use it with the `-t` flag followed by the name of the file in the directory. E.g. If you are on linux calling `gitui -t arc.ron`, this will load the theme in `$XDG_CONFIG_HOME/gitui/arc.ron` or `$HOME/.config/gitui/arc.ron`.

Example theme override:
Example theme override (>= 0.23, < 0.26.2):

```
(
Expand All @@ -25,11 +25,22 @@ Example theme override:

Note that you need to wrap values in `Some` due to the way the overrides work (as of 0.23).

Example theme override (>= 0.26.2):

```
(
selection_bg: Some("Blue"),
selection_fg: Some("#112233"),
)
```

Note that you need to specify colors using strings due to a change in `ratatui` as opposed to bare enum variants (as of 0.26.2).

Notes:

* rgb colors might not be supported in every terminal.
* rgb colors might not be supported in every terminal.
* using a color like `yellow` might appear in whatever your terminal/theme defines for `yellow`
* valid colors can be found in tui-rs' [Color](https://docs.rs/tui/0.12.0/tui/style/enum.Color.html) struct.
* valid colors can be found in tui-rs' [Color](https://docs.rs/tui/0.12.0/tui/style/enum.Color.html) struct.
* all customizable theme elements can be found in [`style.rs` in the `impl Default for Theme` block](https://github.com/extrawurst/gitui/blob/master/src/ui/style.rs#L305)

## Customizing line breaks
Expand Down

0 comments on commit 474bb78

Please sign in to comment.