#226 glColor wrapper doesn't handle tuple of floats properly

GL (74)

In the following fragment of exceptional.py

Either GLdoubleArray should be used or colorDispatch should refer to glColorXfv not glColorXdv. In simpler words types should match or there is no effect to glColor call

colorDispatch = {
3: annotations.glColor3dv,
4: annotations.glColor4dv,

def glColor( *args ):
"""glColor*f* -- convenience function to dispatch on argument type
dispatches to glColor3f, glColor2f, glColor4f, glColor3f, glColor2f, glColor4f
depending on the arguments passed...
arglen = len(args)
if arglen == 1:
arg = arrays.GLfloatArray.asArray( args[0] )
function = glColorDispatch[arrays.GLfloatArray.arraySize( arg )]
return function( arg )
elif arglen == 2:
return simple.glColor2d( *args )
elif arglen == 3:
return simple.glColor3d( *args )
elif arglen == 4:
return simple.glColor4d( *args )
raise ValueError( """Don't know how to handle arguments: %s"""%(args,))

Tested on Gentoo linux,
PyOpengl 3.0.1_beta1 and beta2
Python 2.6.4

email: dedkov@gmail.com


  • Mike C. Fletcher

    • status: open --> closed
  • Mike C. Fletcher

    Revision 346 in bzr should fix this.

  • Mike C. Fletcher

    • status: closed --> closed-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks