You can use setcolor() to change the sprites hue.
Otherwise you'll need to edit the image itself. sprite::getpixel is read only, so it won't be much hel if you want to actually change the colour.
Using image:: getpixel/setpixel
or by copying the result of GetPixelsPtr ()
altering it and then reapplying it to the image with loadfrompixels()
Keep in mind that editing image like this is pretty slow, so you don't want to be doing this every frame. In most cases, simply having two different images should suffice.