By jlnr (dev)
Date 2012-02-26 14:08
This is not a common feature in OpenGL-based libraries because OpenGL does not work with palettes in its textures. I think the best way to achieve this would be via shaders. Shader support is definitely something I'd love to support more in Gosu, but I am not an expert on them. :/
But is this the use case you would be going for? Having a few images where you vary the color spectrum in real-time? If you just need to load the same image with different palettes, this could be done in the file-to-bitmap loading phase, and even in an external library.
Oh, hacky idea: You can probably also use Image#to_blob
and regexps to achieve the same thing relateively efficiently in Ruby, then Image#insert
the blob back in...