I would like to be able to take a Color and convert it into a List<int> so like [0,255,255].
How do I do that?
Use the .r, .b, .g properties which return fractional values (from 0 to 1). Multiply them by 255 and round to get the integer RGB values.
List<int> getRGB(Color c) {
return [
(c.r * 255).round(),
(c.b * 255).round(),
(c.g * 255).round(),
];
}
This method replaces the deprecated usage of .blue, .red, .green.