Skip to content

Commit d4a4cd9

Browse files
authored
fix: fix slice init length (#97)
1 parent fedc174 commit d4a4cd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

convert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ func Rgb2hex(rgb []int) string { return RgbToHex(rgb) }
479479
//
480480
// hex := RgbToHex([]int{170, 187, 204}) // hex: "aabbcc"
481481
func RgbToHex(rgb []int) string {
482-
hexNodes := make([]string, len(rgb))
482+
hexNodes := make([]string, 0, len(rgb))
483483

484484
for _, v := range rgb {
485485
hexNodes = append(hexNodes, strconv.FormatInt(int64(v), 16))

0 commit comments

Comments
 (0)