Skip to content

Commit

Permalink
feat(theme): add 'gruvbox-light' theme (#32)
Browse files Browse the repository at this point in the history
* feat(theme): add 'gruvbox-light' theme

* chore: remove useless comments on gruvbox light theme

* chore: add docstring gruvbox-light contrib link

* style: fix formatting

* fix(theme): update selected item colors

* bg='#EBDBB2'
* fg='#9D0006'

* docs: add gruvbox light theme to themes

* upload theme preview png (1890x1007)

* chore: update gruvbox screenshot

---------

Co-authored-by: Orhun Parmaksız <[email protected]>
  • Loading branch information
mertssmnoglu and orhun authored Jun 22, 2024
1 parent 6698b7c commit af78e04
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ flawz --feeds 2024 --query xz
- [Nord](#nord)
- [One Dark](#one-dark)
- [Solarized Dark](#solarized-dark)
- [Gruvbox Light](#gruvbox-light)
- [Support](#support)
- [Contributing](#contributing)
- [License](#license)
Expand Down Expand Up @@ -168,8 +169,7 @@ flawz [OPTIONS]
-u, --force-update Always fetch feeds
-o, --offline Do not fetch feeds
-q, --query <QUERY> Start with a search query [env: QUERY=]
-t, --theme <THEME> Set the theme [default: dracula] [possible values: dracula, nord, one-dark,
solarized-dark]
-t, --theme <THEME> Set the theme [default: dracula] [possible values: dracula, nord, one-dark, solarized-dark, gruvbox-light]
-h, --help Print help (see more with '--help')
-V, --version Print version
```
Expand Down Expand Up @@ -230,6 +230,10 @@ Start `flawz` with `--theme` option to set a custom theme, e.g. `--theme nord`.

![solarized dark](assets/theme-solarized-dark.jpg)

### Gruvbox Light

![gruvbox light](assets/theme-gruvbox-light.jpg)

## Support

[![Support me on GitHub Sponsors](https://img.shields.io/github/sponsors/orhun?style=flat&logo=GitHub&labelColor=1D272B&color=819188&logoColor=white)](https://github.com/sponsors/orhun)
Expand Down
Binary file added assets/theme-gruvbox-light.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ pub enum BuiltinTheme {
OneDark,
/// Solarized Dark.
SolarizedDark,
/// Gruvbox Light
GruvboxLight,
}

impl BuiltinTheme {
Expand All @@ -24,6 +26,7 @@ impl BuiltinTheme {
BuiltinTheme::Nord => nord_theme(),
BuiltinTheme::OneDark => one_dark_theme(),
BuiltinTheme::SolarizedDark => solarized_dark_theme(),
BuiltinTheme::GruvboxLight => gruvbox_light_theme(),
}
}
}
Expand Down Expand Up @@ -174,3 +177,32 @@ fn solarized_dark_theme() -> Option<Theme> {
scrollbar: Style::default().fg(Color::from_str("#93A1A1").ok()?),
})
}

/// <https://github.com/gruvbox-community/gruvbox-contrib>
fn gruvbox_light_theme() -> Option<Theme> {
Some(Theme {
background: Style::default()
.bg(Color::from_str("#FBF1C7").ok()?)
.fg(Color::from_str("#3C3836").ok()?),
dim: Style::default()
.bg(Color::from_str("#FBF1C7").ok()?)
.fg(Color::from_str("#076678").ok()?),
foreground: Style::default().fg(Color::from_str("#3C3836").ok()?),
header: Style::default()
.bg(Color::from_str("#A89984").ok()?)
.fg(Color::from_str("#3C3836").ok()?),
footer: Style::default()
.bg(Color::from_str("#FBF1C7").ok()?)
.fg(Color::from_str("#3C3836").ok()?),
selected: Style::default()
.bg(Color::from_str("#EBDBB2").ok()?)
.fg(Color::from_str("#9D0006").ok()?),
borders: Style::default().fg(Color::from_str("#076678").ok()?),
separator: Style::default().fg(Color::from_str("#076678").ok()?),
highlight: Style::default().fg(Color::from_str("#076678").ok()?),
index: Style::default().fg(Color::from_str("#076678").ok()?),
input: Style::default().fg(Color::from_str("#928374").ok()?),
input_empty: Style::default().fg(Color::from_str("#9D0006").ok()?),
scrollbar: Style::default().fg(Color::from_str("#282828").ok()?),
})
}

0 comments on commit af78e04

Please sign in to comment.