@Karlos
You know there is an easy way ?
Just put down that MG and embrace the butterfly :-o :-P ;-)
Pains (o.k.cheap joke) are one of the hardest things in AOS-progging,and yes it
is as complicated as you thing.
Basiclly you will need to GetColorMap(),followed by a number of
SetRGB32CM().