Skia SKBitmap.GetPixel returns a different color
I have a very basic use case where I want to count the colors used on an image so I am loading the image on a SKBitmap and looping through getting each pixel color and counting in a bucket.
I get the same amount of colors the original image has (32 colors) but unfortunately I can see that the RGBA colors returned don't seem to match the colors in the image palette. The image renders just fine on a SKCanvasView but as an example, the yellow color in the sample image I'm providing comes back as a pinkish color.
Any ideas what I am missing here? Is there a further conversion I need to make on the pixel color to get the real color?
Code snippet:
var bitmap = SKBitmap.Decode(fileStream);
for (int row = 0; row < bitmap.Height; row++)
for (int col = 0; col < bitmap.Width; col++)
{
var pixelColor = bitmap.GetPixel(col, row); <-- this is not the right color
}