Quote Originally Posted by high_flyer
... if its 8bpp, you have only 255 possible colors, so you will have to deal with that somewhere in your probgram, i.e limmiting the users to choose a color only from the 255 you use.
Exactly, the problem is that with the code that I have posted, although I pass it a valid color from the 255 (in my case a greyscale), it dosen't works