NGL@1.0.0-beta.7 Home Manual Reference Source Gallery
import AtomindexColormaker from 'ngl/src/color/atomindex-colormaker.js'
public class | source

AtomindexColormaker

Extends:

Colormaker → AtomindexColormaker

Color by atom index. The AtomProxy.index property is used for coloring. Each ModelProxy of a Structure is colored seperately. The params.domain parameter is ignored.

Name: atomindex

Example:

stage.loadFile( "rcsb://1crn" ).then( function( o ){
    o.addRepresentation( "ball+stick", { colorScheme: "atomindex" } );
    o.autoView();
} );

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public

Method Summary

Public Methods
public

get color for an atom

Inherited Summary

From class Colormaker
public
public
public
public
public
public
public
public
public
public

safe a atom color to an array

public

bondColor(bond: BondProxy, fromTo: Boolean): Integer

return the color for an bond

public

bondColorToArray(bond: BondProxy, fromTo: Boolean, array: Array | TypedArray, offset: Integer): Array

safe a bond color to an array

public

colorToArray(color: Integer, array: Array | TypedArray, offset: Integer): Array

safe a color to an array

public
public

positionColorToArray(coords: Vector3, array: Array | TypedArray, offset: Integer): Array

safe a color for coordinates in space to an array

public

volumeColorToArray(index: Integer, array: Array | TypedArray, offset: Integer): Array

safe a volume cell color to an array

Public Constructors

public constructor() source

Create a colormaker instance

Override:

Colormaker#constructor

Public Members

public domain source

Override:

Colormaker#domain

public reverse source

Override:

Colormaker#reverse

public scale source

Override:

Colormaker#scale

public scalePerModel source

Public Methods

public atomColor(atom: AtomProxy): Integer source

get color for an atom

Params:

NameTypeAttributeDescription
atom AtomProxy

atom to get color for

Return:

Integer

hex atom color