serializeColorSequence function

Map serializeColorSequence (
  1. ColorSequence colorSequence
)

Implementation

Map serializeColorSequence(ColorSequence colorSequence) {
  List<int> colors = <int>[];
  List<double> stops = <double>[];

  for (int i = 0 ; i < colorSequence.colors.length; i++) {
    colors.add(serializeColor(colorSequence.colors[i]));
    stops.add(colorSequence.colorStops[i]);
  }

  return {
    'colors': colors,
    'colorStops': stops,
  };
}