Skip to content

Commit

Permalink
util: (parsing) Prepend # in ParseHexColorFast() instead of erroring
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT2 committed Jun 13, 2024
1 parent a5e4d15 commit 3ea8a24
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions util/parsing.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ func ParseHexColorFast(s string) (c color.RGBA, err error) {
c.A = 0xff

if s[0] != '#' {
err = errors.New(fmt.Sprintf("`%s` must start with #", s))
return
s = "#" + s
}

hexToByte := func(b byte) byte {
Expand Down

0 comments on commit 3ea8a24

Please sign in to comment.