Color graphical entity by property using a gradient
- See Also
- Gradient Example
4 ent=io.LoadEntity(pdb_name)
6 vv=ent.Select(
'peptide=true and aname=CA,N,C,O')
7 gradient=gfx.Gradient()
8 gradient.SetColorAt(1.0, gfx.Color(1.0, 0.0, 0.0, 1.0))
9 gradient.SetColorAt(0.5, gfx.Color(0.0, 1.0, 0.0, 1.0))
10 gradient.SetColorAt(0.0, gfx.Color(0.0, 0.0, 1.0, 1.0))
12 go=gfx.Entity(os.path.splitext(os.path.basename(pdb_name))[0], vv)
13 go.ColorBy(
'abfac', gradient)
15 scene.center=go.center