List<int> colorValuesToJson(List<Color> colorValues) { List<int> intColorValues = <int>[]; colorValues.forEach((element) { intColorValues.add(element.value); }); return intColorValues; }