1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00
wakapi/utils/color.go

17 lines
347 B
Go
Raw Normal View History

2020-03-31 12:24:44 +03:00
package utils
import (
2020-03-31 13:22:17 +03:00
"github.com/muety/wakapi/models"
2020-03-31 12:24:44 +03:00
"strings"
)
func FilterColors(all map[string]string, haystack models.SummaryItems) map[string]string {
2020-03-31 12:24:44 +03:00
subset := make(map[string]string)
for _, item := range haystack {
2020-03-31 12:24:44 +03:00
if c, ok := all[strings.ToLower(item.Key)]; ok {
subset[strings.ToLower(item.Key)] = c
}
}
return subset
}