Skip to content

Commit

Permalink
feat(theme): add 'gruvbox-material-dark-hard' theme (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
G4bbix authored Nov 22, 2024
1 parent c82e882 commit 795f075
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ flawz --feeds 2024 --query xz
- [One Dark](#one-dark)
- [Solarized Dark](#solarized-dark)
- [Gruvbox Light](#gruvbox-light)
- [Gruvbox Material Dark Hard](#gruvbox-material-dark-hard)
- [Support](#support)
- [Contributing](#contributing)
- [License](#license)
Expand Down Expand Up @@ -176,7 +177,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, gruvbox-light]
-t, --theme <THEME> Set the theme [default: dracula] [possible values: dracula, nord, one-dark, solarized-dark, gruvbox-light, gruvbox-material-dark-hard]
-h, --help Print help (see more with '--help')
-V, --version Print version
```
Expand Down Expand Up @@ -241,6 +242,10 @@ Start `flawz` with `--theme` option to set a custom theme, e.g. `--theme nord`.

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

### Gruvbox Material Dark Hard

![gruvbox material dark hard](assets/theme-gruvbox-material-dark-hard.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-material-dark-hard.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 @@ -16,6 +16,8 @@ pub enum BuiltinTheme {
SolarizedDark,
/// Gruvbox Light
GruvboxLight,
/// Gruvbox Material Dark Hard
GruvboxMaterialDarkHard,
}

impl BuiltinTheme {
Expand All @@ -27,6 +29,7 @@ impl BuiltinTheme {
BuiltinTheme::OneDark => one_dark_theme(),
BuiltinTheme::SolarizedDark => solarized_dark_theme(),
BuiltinTheme::GruvboxLight => gruvbox_light_theme(),
BuiltinTheme::GruvboxMaterialDarkHard => gruvbox_material_dark_hard_theme(),
}
}
}
Expand Down Expand Up @@ -206,3 +209,32 @@ fn gruvbox_light_theme() -> Option<Theme> {
scrollbar: Style::default().fg(Color::from_str("#282828").ok()?),
})
}

/// <https://github.com/sainnhe/gruvbox-material>
fn gruvbox_material_dark_hard_theme() -> Option<Theme> {
Some(Theme {
background: Style::default()
.bg(Color::from_str("#1D2021").ok()?)
.fg(Color::from_str("#D4BE98").ok()?),
dim: Style::default()
.bg(Color::from_str("#1D2021").ok()?)
.fg(Color::from_str("#7DAEA3").ok()?),
foreground: Style::default().fg(Color::from_str("#3C3836").ok()?),
header: Style::default()
.bg(Color::from_str("#7C6F64").ok()?)
.fg(Color::from_str("#D4BE94").ok()?),
footer: Style::default()
.bg(Color::from_str("#1D2021").ok()?)
.fg(Color::from_str("#D4BE94").ok()?),
selected: Style::default()
.bg(Color::from_str("#32302F").ok()?)
.fg(Color::from_str("#EA6962").ok()?),
borders: Style::default().fg(Color::from_str("#7DAEA3").ok()?),
separator: Style::default().fg(Color::from_str("#7DAEA3").ok()?),
highlight: Style::default().fg(Color::from_str("#7DAEA3").ok()?),
index: Style::default().fg(Color::from_str("#7DAEA3").ok()?),
input: Style::default().fg(Color::from_str("#928374").ok()?),
input_empty: Style::default().fg(Color::from_str("#EA6962").ok()?),
scrollbar: Style::default().fg(Color::from_str("#EDDEB5").ok()?),
})
}

0 comments on commit 795f075

Please sign in to comment.