I have a bitmap palette where i can easily change a single color for the whole palette or all of them by inverting them all for example:
for (int i = 0; i < sprite.Palette.Length; i++)
{
int r = Byte.MaxValue - sprite.Palette[i].R;
int g = Byte.MaxValue - sprite.Palette[i].G;
int b = Byte.MaxValue - sprite.Palette[i].B;
sprite.Palette[i] = Color.FromArgb(r, g, b);
}
But i don't want to change all the colors. I just want to change certain pixels in the palette. If it was a Bitmap i could just do this:
sprite[i].Bitmap.SetPixel(x, y, Color.FromArgb(0, 0, 255));
Which would just change those pixels at x & y, but obviously that doesn't work for a palette.
Edit: would need to convert the bitmap back to a byte array, but seeing as it is a sprite the usual methods to converting bitmap to byte array don't work..