Last updated

API / geotoolkit / contour / visuals / VisualColorMap / VisualColorMap

Class: VisualColorMap

visuals.VisualColorMap.VisualColorMap

This class stores the colorMap table for the Visuals (AbstractVisual and its derivatives).

Table of contents

Constructors
[new VisualColorMap(visual)](/solutions/geotoolkit/apis/classes/geotoolkit.contour.visuals.visualcolormap.visualcolormap.md#new visualcolormap(visual))[new VisualColorMap(visual, colors)](/solutions/geotoolkit/apis/classes/geotoolkit.contour.visuals.visualcolormap.visualcolormap.md#new visualcolormap(visual, colors))
Methods
Css Properties
Name Type Description
visualAbstractVisualThe associated visual
visual-clipstyleClipStyleClipping style
visual-clipstyle-evenoddbooleanTrue if evenodd mode is on ('nonzero' mode otherwise)
visual-clipstyle-geometryGraphicsPathClipping geometry
visual-clipstyle-geometry-boundsRectBounds
visual-clipstyle-geometry-bounds-heightnumberHeight
visual-clipstyle-geometry-bounds-readonlybooleanReadonly
visual-clipstyle-geometry-bounds-widthnumberWidth
visual-clipstyle-geometry-bounds-xnumberLeft
visual-clipstyle-geometry-bounds-ynumberTop
visual-clipstyleGraphicsPathClipping style
visual-colorbehaviorBehaviorTypeColor behavior type
visual-colormapVisualColorMapColormap properties
visual-cssclassstringThe css class name of this node
visual-csscursorstringCSS cursor associated with node
visual-cssstylestringCSS style to be applied to inserted elements
visual-fillstylestringStyle applied on fill
visual-fillstyleFillStyleStyle applied on fill
visual-fillstyle-colorstringColor in CSS form
visual-fillstyle-evenoddmodebooleanEven-odd fill mode
visual-fillstyle-fillpatternPatternPattern
visual-fillstyle-fillpattern-containernamestringAn optional container name, which creates an image pattern. This parameter is used for serialization if you want to save are reference to pattern instead of the pattern itself
visual-fillstyle-fillpattern-patternnamestringName of this pattern for indexing
visual-fillstyle-fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
visual-fillstyle-foregroundstringForeground color
visual-fillstyle-patternPatternPattern
visual-idstring | numberId of the node, its a unique identifier
visual-linestylestringStyle applied on outline
visual-linestyleLineStyleStyle applied on outline
visual-linestyle-colorstringColor in CSS form
visual-linestyle-fillstringOptional fill style to be used to fill lines generated with this style
visual-linestyle-fillFillStyleOptional fill style to be used to fill lines generated with this style
visual-linestyle-linecapCapStyleThe line cap style
visual-linestyle-linedashoffsetnumberLine dash offset of dashed line
visual-linestyle-linejoinJoinStyleThe line join style
visual-linestyle-pixelsnapmodebooleanPixel Snap Mode, default(
visual-linestyle-scalablebooleanTrue if width should depend on transformation
visual-linestyle-unitstringOptional unit for the width
visual-linestyle-widthnumber | stringThe line thickness
visual-localtransformTransformationLocal transformation
visual-localtransform-dxnumberX axis translation
visual-localtransform-dynumberY axis translation
visual-localtransform-xxnumberX scale
visual-localtransform-xynumberXy skew
visual-localtransform-yxnumberYx skew
visual-localtransform-yynumberY scale
visual-marginsnumber | stringIt has properties for specifying the margins for each side
visual-namestringName of the node. It is often used for debugging purposes or to simplify queries
visual-opacitynumberNode opacity (from 0 to 1). If it is undefined or null it inherits property from the parent. It changes globalAlpha on the rendering context
visual-opacityblendmodeBlendModeNode opacity mode to blend it
visual-scalescrollstrategyScaleScrollStrategyScale scroll strategy
visual-scalescrollstrategy-enabledbooleanEnable flag
visual-selectablebooleanSelectable node, a boolean to determine if selection should consider this node
visual-taganyCustom information associated with node. It is a user object which can be used by client code to store information or attach an application object to the shape
visual-transformstringAdditional CSS transformation applied to node or 'none'
visual-transformTransformationAdditional CSS transformation applied to node or 'none'
visual-visiblebooleanVisibility of the node, a boolean to determine if the node should be rendered or not
visual-z-indexnumberDefine node z-index

Contents

Constructors

new VisualColorMap(visual)

new VisualColorMap(visual?)

Parameters

Name Type
Optional visualOptions

new VisualColorMap(visual, colors)

new VisualColorMap(visual?, colors?)

Parameters

Name Type Description
Optional visualAbstractVisualThe associated visual
Optional colorsVisualColorMapthe colorMap
Methods

clone

clone(): VisualColorMap

Make and return a deep copy of this colorMap

Returns

VisualColorMap

clone The cloned colorMap.


deleteColors

deleteColors(start, end): void

Delete the colors in the range nStart->nEnd inclusive. Not used by any of the Visuals classes - only used by the Editor classes.

Parameters

Name Type Description
startnumberStart of range to delete
endnumberEnd of range to delete

Returns

void


getClassName

getClassName(): string

Returns

string


getColorFor

getColorFor(index): string

Returns the Color for the supplied index.

Parameters

Name Type Description
indexnumberIndex for the requested color.

Returns

string

color The requested color for this index.


getColors

getColors(): string[]

Gets the colorMap as an array of color strings.

Returns

string[]

colors The colorMap colors in string format.


getProperties

getProperties(): Options

Gets the colorMap properties

Returns

Options

colorMap properties


getSize

getSize(): number

Gets the size of the colorMap.

Returns

number

size The size of the colorMap.


insertColor

insertColor(nStart): void

Insert a new color into the colorMap. Not used by any of the Visuals classes - only used by the Editor classes. Set nStart to Size to insert at the end of the colorMap

Parameters

Name Type Description
nStartnumberIndex to insert new color at. The color at this index will be copied.

Returns

void


interpolate

interpolate(nStart, nEnd): void

Interpolate colors in the colorMap. Not used by any of the Visuals classes - only used by the Editor classes.

Parameters

Name Type Description
nStartnumberStart of range to interpolate (this color stays the same)
nEndnumberEnd of range to delete (this color stays the same)

Returns

void


rotate

rotate(nStart, nEnd, delta): void

Rotates colors in the colorMap, in a positive direction. Ie. index 0 -> index (delta). Can also handle negative delta values

Parameters

Name Type Description
nStartnumberStart of range to rotate.
nEndnumberEnd (inclusive) of range to rotate.
deltanumberThe rotation value.

Returns

void


setColorFor

setColorFor(index, color): VisualColorMap

Sets the Color object for the supplied colorMap index. This is required for the Editor dialog boxes, and is not used by any of the visuals to modify a supplied colorMap.

Parameters

Name Type Description
indexnumberIndex into the colorMap.
colorstringThe new color for this index.

Returns

VisualColorMap

this


setColors

setColors(colors): VisualColorMap

Sets the colorMap colors.

Parameters

Name Type Description
colorsstring[]The colorMap colors in string format.

Returns

VisualColorMap

this


setProperties

setProperties(props?): VisualColorMap

Sets the colorMap properties

Parameters

Name Type Description
Optional propsOptionscolorMap properties

Returns

VisualColorMap

this


getClassName

Static getClassName(): string

Returns

string