Draw a set of lines and color them using a gradient
lines=gfx.PrimList("lines")
g=gfx.Gradient()
g.SetColorAt(0, gfx.Color(1.0, 0.0, 0.0, 1.0))
g.SetColorAt(0.5, gfx.Color(0.0, 1.0, 0.0, 1.0))
g.SetColorAt(1.0, gfx.Color(0.0, 0.0, 1.0, 1.0))
for i in range(1000):
c=g.GetColorAt(0.001*i)
scene.Add(lines)