fix AIOOB

This commit is contained in:
Konstantin Bulenkov
2016-07-18 14:12:26 +02:00
parent f493d9e03b
commit 127db3831e
@@ -66,7 +66,7 @@ public class RainbowHighlighter {
if (!registryColors.isEmpty()) {
final List<Color> colors = registryColors.stream().map((s -> ColorUtil.fromHex(s.trim()))).collect(Collectors.toList());
if (!colors.isEmpty()) {
return colors.get(hash % colors.size());
return colors.get(Math.abs(hash) % colors.size());
}
}