Color is not applied when drawing fonts in BGE with blf and bgl I am trying to get fonts rendered with different colors, but bgl.glColor4f (or any other variant of glColor) doesn't apply the color that I set with it. Please see https://github.com/eugenschindler/blender-examples/tree/master/HUDText for a reproduction of the problem (Blend file, Python script, and font).
According to other resources I found online, this example code should work, but I can't get it to work.
I've used Blender 2.73 and 2.75 and in both it doesn't work.
Does anybody have an idea what's going wrong?
The problem was lying in the Shading settings of Blender. By default, the shading is set to Multitexture, which makes the blf text be only black. If you set the shader to GLSL (see picture below), the colors behave exactly as you would expect them according to the python script that is in my example.