Skip to content

Commit

Permalink
feat: add all theme options
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Feb 1, 2024
1 parent 1c249de commit b1f71b4
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 4 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ require (
golang.org/x/term v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
)

replace github.com/charmbracelet/huh => ../huh
71 changes: 67 additions & 4 deletions interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func runForm(config *Config) (*Config, error) {
config.Output = strings.TrimSuffix(base, ext) + ".svg"
}

theme.Blurred.SelectedOption = theme.Blurred.SelectedOption.Copy().Foreground(lipgloss.Color("243"))
theme.Focused.SelectedOption = theme.Focused.SelectedOption.Copy().Foreground(lipgloss.Color("7"))
theme.Blurred.Description = theme.Blurred.Description.Copy().Foreground(lipgloss.Color("0"))
theme.Focused.Description = theme.Focused.Description.Copy().Foreground(lipgloss.Color("7"))
theme.Blurred.Title = theme.Blurred.Title.Copy().Width(14).Foreground(lipgloss.Color("7"))
Expand All @@ -84,12 +86,10 @@ func runForm(config *Config) (*Config, error) {
Prompt("").
Value(&config.Output),

huh.NewInput().Title("Theme ").
Placeholder("charm").
huh.NewSelect[string]().Title("Theme ").
// Description("Theme for syntax highlighting.").
Suggestions([]string{"charm", "dracula"}).
Inline(true).
Prompt("").
Options(themes...).
Value(&config.Theme),

huh.NewInput().Title("Background ").
Expand Down Expand Up @@ -280,3 +280,66 @@ func parsePadding(v string) []int {
}

var parseMargin = parsePadding

var themes = []huh.Option[string]{
huh.NewOption("abap", "abap"),
huh.NewOption("algol", "algol"),
huh.NewOption("algol_nu", "algol_nu"),
huh.NewOption("arduino", "arduino"),
huh.NewOption("autumn", "autumn"),
huh.NewOption("average", "average"),
huh.NewOption("base16-snazzy", "base16-snazzy"),
huh.NewOption("borland", "borland"),
huh.NewOption("bw", "bw"),
huh.NewOption("catppuccin-frappe", "catppuccin-frappe"),
huh.NewOption("catppuccin-latte", "catppuccin-latte"),
huh.NewOption("catppuccin-macchiato", "catppuccin-macchiato"),
huh.NewOption("catppuccin-mocha", "catppuccin-mocha"),
huh.NewOption("colorful", "colorful"),
huh.NewOption("doom-one", "doom-one"),
huh.NewOption("doom-one2", "doom-one2"),
huh.NewOption("dracula", "dracula"),
huh.NewOption("emacs", "emacs"),
huh.NewOption("friendly", "friendly"),
huh.NewOption("fruity", "fruity"),
huh.NewOption("github", "github"),
huh.NewOption("github-dark", "github-dark"),
huh.NewOption("gruvbox", "gruvbox"),
huh.NewOption("gruvbox-light", "gruvbox-light"),
huh.NewOption("hr_high_contrast", "hr_high_contrast"),
huh.NewOption("hrdark", "hrdark"),
huh.NewOption("igor", "igor"),
huh.NewOption("lovelace", "lovelace"),
huh.NewOption("manni", "manni"),
huh.NewOption("modus-operandi", "modus-operandi"),
huh.NewOption("modus-vivendi", "modus-vivendi"),
huh.NewOption("monokai", "monokai"),
huh.NewOption("monokailight", "monokailight"),
huh.NewOption("murphy", "murphy"),
huh.NewOption("native", "native"),
huh.NewOption("nord", "nord"),
huh.NewOption("onedark", "onedark"),
huh.NewOption("onesenterprise", "onesenterprise"),
huh.NewOption("paraiso-dark", "paraiso-dark"),
huh.NewOption("paraiso-light", "paraiso-light"),
huh.NewOption("pastie", "pastie"),
huh.NewOption("perldoc", "perldoc"),
huh.NewOption("pygments", "pygments"),
huh.NewOption("rainbow_dash", "rainbow_dash"),
huh.NewOption("rose-pine", "rose-pine"),
huh.NewOption("rose-pine-dawn", "rose-pine-dawn"),
huh.NewOption("rose-pine-moon", "rose-pine-moon"),
huh.NewOption("rrt", "rrt"),
huh.NewOption("solarized-dark", "solarized-dark"),
huh.NewOption("solarized-dark256", "solarized-dark256"),
huh.NewOption("solarized-light", "solarized-light"),
huh.NewOption("swapoff", "swapoff"),
huh.NewOption("tango", "tango"),
huh.NewOption("trac", "trac"),
huh.NewOption("vim", "vim"),
huh.NewOption("vs", "vs"),
huh.NewOption("vulcan", "vulcan"),
huh.NewOption("witchhazel", "witchhazel"),
huh.NewOption("xcode", "xcode"),
huh.NewOption("xcode-dark", "xcode-dark"),
}

0 comments on commit b1f71b4

Please sign in to comment.