CustomLinear

Custom linear gradient using user supplied colors.
Reverse gradients are supported when min>max so that the colors are displayed in reverse order.
Midpoints are not supported - color map should be specified to get desired middle color.

Constructor

new CustomLinear(min, max, colors)

Parameters:
NameTypeDescription
minnumber
maxnumber
colorsArray

Array of colors that will be linearly interpolated between from min to max values.

Example
$3Dmol.get('../test_structs/af.pdb', function(data){
              viewer.addModel(data);
              viewer.setStyle({cartoon:{colorscheme:{prop: 'b', gradient:'linear', min: 70, max: 100, colors: ["blue","yellow","green"]}}});
              viewer.zoomTo();
              viewer.render();
            });

Classes

CustomLinear