buildOffset method
It takes a list of colors and an offset, and returns a new list of colors with the offset applied
Args:
colors (List
Returns: A new list of colors that is offset by the offset parameter.
Implementation
List<int> buildOffset(List<int> colors, int offset) {
final int i = offset % colors.length;
final List<int> newColors = colors.sublist(i)..addAll(colors.sublist(0, i));
return newColors;
}