mirror of
https://github.com/6543/go-hexcolor
synced 2024-12-18 15:54:17 +00:00
faster ...
This commit is contained in:
parent
c32969ffb1
commit
e2d3f41734
@ -24,7 +24,7 @@ func NewHexColor(hc string) (*HexColor, error) {
|
||||
return c, nil
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user