getColor function
Implementation
Color getColor(List<Color> colorList, int index) {
if (index > (colorList.length - 1)) {
final newIndex = index % (colorList.length - 1);
return colorList.elementAt(newIndex);
}
return colorList.elementAt(index);
}