Update color.go
This commit is contained in:
parent
3427ea1717
commit
d72068d194
1 changed files with 1 additions and 1 deletions
|
|
@ -167,7 +167,7 @@ func (c *RGB) IsLight() bool {
|
|||
// https://gist.github.com/CraigChilds94/6514edbc6a2db5e434a245487c525c75
|
||||
func Hex2RGB(hex string) (RGB, error) {
|
||||
var rgb RGB
|
||||
if hex[0:1] == "#" {
|
||||
if len(hex) > 3 && hex[0] == '#' {
|
||||
hex = hex[1:]
|
||||
} else {
|
||||
return RGB{}, fmt.Errorf("cannot parse hex color %v", hex)
|
||||
|
|
|
|||
Loading…
Reference in a new issue