[SDL] How to gray out a button image?

Will Langford unfies at gmail.com
Tue Apr 8 19:20:28 PDT 2008


>  grayed = (source_pixel_red * 0.10) + (source_pixel_green * 0.61) +
>  (source_pixel_blue * 0.19);

Doh, mistyped math in the line,

grayed = (source_pixel_red * 0.30) + (source_pixel_green * 0.59) +
(source_pixel_blue * 0.11);

-Will


More information about the SDL mailing list