Skip to content

Commit

Permalink
fix: create hex color
Browse files Browse the repository at this point in the history
  • Loading branch information
op committed May 11, 2024
1 parent 31924aa commit 388c271
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/catppuccin/theme.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ var Theme = logtheme.New(

func hexColor(c lipgloss.TerminalColor) string {
if c, ok := c.(lipgloss.Color); ok {
return string(c)
hex := string(c)
if len(hex) == 7 {
return hex
}
}
// TODO: fix
r, g, b, _ := c.RGBA()
return fmt.Sprintf("#%02x%02x%02x", r, g, b)
return fmt.Sprintf("#%02x%02x%02x", r/0xff, g/0xff, b/0xff)
}

func newVariant(f Variant) logtheme.Variant {
Expand Down

0 comments on commit 388c271

Please sign in to comment.