I’m developing a game client in which texture colors are stored as int values. Sometimes, however, I have to use 16bit colors to draw some texture… so I would like to know how to convert 32bit color to 16bit color and vice versa… preferably avoiding managed functions like Color.FromArgb() and similar. I prefer to achieve those operations as fast as possible with byte shifting.
Do you also know how to get the grayscale value of a 32 bit color?
I’m developing a game client in which texture colors are stored as int values.
Share
For what concerns grayscaling… you could try the following function but I just wrote it without testing so I cannot guarantee it will work perfectly: