20 lines
362 B
Go
20 lines
362 B
Go
|
package attribute
|
||
|
|
||
|
import (
|
||
|
"strconv"
|
||
|
"strings"
|
||
|
|
||
|
"gitlab.codemonkeysoftware.net/b/hatmill"
|
||
|
)
|
||
|
|
||
|
func Coords(values ...float32) hatmill.Attrib {
|
||
|
s := make([]string, 0, len(values))
|
||
|
for _, value := range values {
|
||
|
s = append(s, strconv.FormatFloat(float64(value), 'G', -1, 32))
|
||
|
}
|
||
|
return hatmill.Attrib{
|
||
|
Key: "coords",
|
||
|
Value: strings.Join(s, ","),
|
||
|
}
|
||
|
}
|