Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more themes #6

Open
orhun opened this issue May 18, 2024 · 0 comments
Open

Add more themes #6

orhun opened this issue May 18, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@orhun
Copy link
Owner

orhun commented May 18, 2024

Is your feature request related to a problem? Please describe.

The currently supported themes are listed in README.md and we need more themes!

Describe the solution you'd like

Adding a theme is easy:

  1. Add the new variant to BuiltinTheme enum:

flawz/src/theme.rs

Lines 5 to 17 in 32fb9ac

/// Built-in theme.
#[derive(Debug, Clone, PartialEq, ValueEnum, Default)]
pub enum BuiltinTheme {
/// Dracula.
#[default]
Dracula,
/// Nord.
Nord,
/// One Dark.
OneDark,
/// Solarized Dark.
SolarizedDark,
}

  1. Add a new function for the theme colors:

flawz/src/theme.rs

Lines 62 to 89 in 32fb9ac

/// <https://draculatheme.com/contribute>
fn dracula_theme() -> Option<Theme> {
Some(Theme {
background: Style::default()
.bg(Color::from_str("#282A36").ok()?)
.fg(Color::from_str("#F8F8F2").ok()?),
dim: Style::default()
.bg(Color::from_str("#282A36").ok()?)
.fg(Color::from_str("#44475A").ok()?),
foreground: Style::default().fg(Color::from_str("#F8F8F2").ok()?),
header: Style::default()
.bg(Color::from_str("#BD93F9").ok()?)
.fg(Color::from_str("#282A36").ok()?),
footer: Style::default()
.bg(Color::from_str("#282A36").ok()?)
.fg(Color::from_str("#8BE9FD").ok()?),
selected: Style::default()
.bg(Color::from_str("#44475A").ok()?)
.fg(Color::from_str("#FFB86C").ok()?),
borders: Style::default().fg(Color::from_str("#44475A").ok()?),
separator: Style::default().fg(Color::from_str("#6272A4").ok()?),
highlight: Style::default().fg(Color::from_str("#F1FA8C").ok()?),
index: Style::default().fg(Color::from_str("#BD93F9").ok()?),
input: Style::default().fg(Color::from_str("#50FA7B").ok()?),
input_empty: Style::default().fg(Color::from_str("#FF79C6").ok()?),
scrollbar: Style::default().fg(Color::from_str("#6272A4").ok()?),
})
}

  1. Add screenshot in assets/ and update README.md

Describe alternatives you've considered

None.

Additional context

I would love to have a light theme.

@orhun orhun added enhancement New feature or request good first issue Good for newcomers labels May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant