Skip to content

Commit

Permalink
fix: linter warning
Browse files Browse the repository at this point in the history
  • Loading branch information
flopp committed Apr 21, 2024
1 parent b888ad1 commit 74b65f9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions color.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import (

// ParseColorString parses hex color strings (i.e. `#RRGGBB`, `RRGGBBAA`, `#RRGGBBAA`), and named colors (e.g. 'black', 'blue', ...)
func ParseColorString(s string) (color.Color, error) {
if col, err := csscolorparser.Parse(s); err != nil {
col, err := csscolorparser.Parse(s)
if err != nil {
return nil, err
} else {
r, g, b, a := col.RGBA255()
return color.RGBA{r, g, b, a}, nil
}

r, g, b, a := col.RGBA255()
return color.RGBA{r, g, b, a}, nil
}

// Luminance computes the luminance (~ brightness) of the given color. Range: 0.0 for black to 1.0 for white.
Expand Down

0 comments on commit 74b65f9

Please sign in to comment.