See here for
Once downloaded, from withinPyMOL run
to load the function definition. Then, use for example:
to color chains A and B with the rainbow colors in 30 colors of equal numbers of atoms in each color.
Or in general, this can be used as follows:
This function allows coloring of a selection as a function of B-value, either in a range of hues from blue through magenta to red (rainbow=0, the default) or in the colors of the rainbow (rainbow=1). The division of B-value ranges can either be as a histogram (equal-sized B-value increments leading to unequal numbers of atoms in each bin: ramp=0) or as a ramp of B-value ranges with an equal number of atoms in each group (ramp=1).