Skip to content

Commit

Permalink
fix: index out of range error in quantColour function (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
anrgct committed Jul 21, 2024
1 parent 95597b6 commit 580baaf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ func quantColour(quant string) lipgloss.Color {
if !exists {
index = 0 // Default to lightest if unknown quant
}
if index >= len(synthGradient) {
index = len(synthGradient) - 1 // Use the last valid index
}
return lipgloss.Color(synthGradient[index])
}

Expand Down

0 comments on commit 580baaf

Please sign in to comment.