Why store the colors as an int and then do all those shifts and divides to get a float, why not use glColor4fv and pass it a float pointer... renderGrid(float * color, ... )    then glColor4fv(color)