We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fedc174 commit d4a4cd9Copy full SHA for d4a4cd9
convert.go
@@ -479,7 +479,7 @@ func Rgb2hex(rgb []int) string { return RgbToHex(rgb) }
479
//
480
// hex := RgbToHex([]int{170, 187, 204}) // hex: "aabbcc"
481
func RgbToHex(rgb []int) string {
482
- hexNodes := make([]string, len(rgb))
+ hexNodes := make([]string, 0, len(rgb))
483
484
for _, v := range rgb {
485
hexNodes = append(hexNodes, strconv.FormatInt(int64(v), 16))
0 commit comments