1
0
mirror of https://github.com/6543/go-hexcolor synced 2024-12-18 15:54:17 +00:00

faster ...

This commit is contained in:
6543 2020-09-10 22:58:35 +02:00
parent c32969ffb1
commit e2d3f41734
Signed by: 6543
GPG Key ID: A1CA74D27FD13271

View File

@ -24,7 +24,7 @@ func NewHexColor(hc string) (*HexColor, error) {
return c, nil return c, nil
} }
if len(hc) == 3 { if len(hc) == 3 {
c.hex = hc[:1] + hc[:1] + hc[1:][:1] + hc[1:][:1] + hc[2:] + hc[2:] c.hex = string([]byte{hc[0], hc[0], hc[1], hc[1], hc[2], hc[2]})
return c, nil return c, nil
} }
} }