Class

CustomLinear

CustomLinear(min, max, colors)

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:
Name Type Description
min number
max number
colors Array

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

View Source Gradient.ts, line 306

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