Shared GUI for Bridge and Import/Export

This commit is contained in:
Jakub
2020-05-27 15:58:50 +02:00
committed by Michal Horejsek
parent b598779c0f
commit 49316a935c
96 changed files with 11469 additions and 209 deletions

View File

@ -175,3 +175,21 @@ func (c *client) DeleteLabel(id string) (err error) {
err = res.Err()
return
}
// LeastUsedColor is intended to return color for creating a new inbox or label
func LeastUsedColor(colors []string) (color string) {
color = LabelColors[0]
frequency := map[string]int{}
for _, c := range colors {
frequency[c]++
}
for _, c := range LabelColors {
if frequency[color] > frequency[c] {
color = c
}
}
return
}