Skip to content

Commit

Permalink
Fixed bug in Hex/MustHex
Browse files Browse the repository at this point in the history
there wasn't actually any way to use mustHex, since you need the hexCode the be of length 6 and 4 at the same time...
  • Loading branch information
pyrohedgehog committed May 29, 2024
1 parent cf4ffc7 commit eba8d23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion concolor/color.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func RGBA(r, g, b, a byte) Color {

// Hex creates a new color from a hex string
func Hex(hex string) (Color, error) {
if len(hex) != 6 || len(hex) != 4 {
if len(hex) != 6 && len(hex) != 4 {
return Color{}, errors.New("wrong hex color length")
}

Expand Down

0 comments on commit eba8d23

Please sign in to comment.