Can I get a list of RGB colors from a graphics object?

I'm wondering if it is possible to get the list of RGBColor from a plot.

What I mean is simple. Suppose I plot list L with "TemperatureMap":

L={1,2,3,4,5,6,8,10};
P1=ListPlot[L,ColorFunction -> ColorData["TemperatureMap"]]


Getting a simple plot:

Can I retrieve from the graphics object P1, the list of RGBColor elements used? (i.e. the color values for each dot in the ListPlot)

colorList= {RGBcolor[],...,RGBcolor[]}

Thanks!

Pedro

coordsandcolors = DeleteDuplicates @ Cases[P1, GraphicsComplex[coords_, __,

• It is worth to note that ListPlot behaves this way only in version 12.0. In version 11.3 it produces a plot with all the points of identical color. And in version 12.0 we have a bug: applying Normal changes the plot to the previous version's styling (just removes VertexColors information). – Alexey Popkov Sep 27 at 3:49
• @AlexeyPopkov, excellent points. (Actually, Normal[P1] was my first try.) – kglr Sep 27 at 3:53