cool I just had the idea.
generate 2 different images. 1 the graphic without the color i want to change and the other one just the part of the graphic of which I want to change the color. After changing the color I simply merge them an save it and Bingo.
Does that sound like its possible?