Nope, do need that while

This commit is contained in:
Rashid Khan 2016-01-04 17:02:46 -07:00
parent b8e54c865b
commit 5ffe6f9519

View file

@ -42,7 +42,10 @@ define((require) => (Private, config) => {
const allColors = _(this.mapping).values().union(configColors).value();
const colorPalette = createColorPalette(allColors.length + keysToMap.length);
let newColors = _.difference(colorPalette, allColors);
newColors = newColors.concat(_.sample(allColors, keysToMap.length - newColors.length));
while (keysToMap.length > newColors.length) {
newColors = newColors.concat(_.sample(allColors, keysToMap.length - newColors.length));
}
_.merge(this.mapping, _.zipObject(keysToMap, newColors));
}