NGL@0.10.4 Home Manual Reference Source GalleryRepository
import Colormaker from 'ngl/src/color/colormaker.js'
public interface | source

Colormaker

Class for making colors.

Constructor Summary

Public Constructor
public

Create a colormaker instance

Method Summary

Public Methods
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

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(params: ColormakerParameters) source

Create a colormaker instance

Params:

NameTypeAttributeDescription
params ColormakerParameters

colormaker parameter

Public Methods

public atomColorToArray(atom: AtomProxy, array: Array | TypedArray, offset: Integer): Array source

safe a atom color to an array

Params:

NameTypeAttributeDescription
atom AtomProxy

atom to get color for

array Array | TypedArray

destination

offset Integer

index into the array

Return:

Array

the destination array

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

return the color for an bond

Params:

NameTypeAttributeDescription
bond BondProxy

bond to get color for

fromTo Boolean

whether to use the first or second atom of the bond

Return:

Integer

hex bond color

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

safe a bond color to an array

Params:

NameTypeAttributeDescription
bond BondProxy

bond to get color for

fromTo Boolean

whether to use the first or second atom of the bond

array Array | TypedArray

destination

offset Integer

index into the array

Return:

Array

the destination array

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

safe a color to an array

Params:

NameTypeAttributeDescription
color Integer

hex color value

array Array | TypedArray

destination

offset Integer

index into the array

Return:

Array

the destination array

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

safe a color for coordinates in space to an array

Params:

NameTypeAttributeDescription
coords Vector3

xyz coordinates

array Array | TypedArray

destination

offset Integer

index into the array

Return:

Array

the destination array

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

safe a volume cell color to an array

Params:

NameTypeAttributeDescription
index Integer

volume cell index

array Array | TypedArray

destination

offset Integer

index into the array

Return:

Array

the destination array