Last updated

API / geotoolkit / attributes / RadialGradientStyle / RadialGradientStyle

Class: RadialGradientStyle

attributes.RadialGradientStyle.RadialGradientStyle

Defines a radial gradient fill style, which represents a gradient of colors along of cone between two circles.
Radial gradients are defined with relative numbers from 0-1 describing the inner and outer circles. radius values are percentages of the shape's radius

Hierarchy

Table of contents

Constructors
Accessors
Methods
Css Properties
Name Type Description
colorstringColor in CSS form
endcolorstringEnd color in CSS format
evenoddmodebooleanEven-odd fill mode
fillpatternPatternPattern
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
fillpattern-patternnamestringName of this pattern for indexing
fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
foregroundstringForeground color
innercenterPointCenterpoint of inner circle of gradient in relative form, 0-1 or absolute coordinates
innercenter-xnumberX coordinate
innercenter-ynumberY coordinate
innerradiusnumberRadius of inner circle in relative form, 0-1 or absolute coordinates
outercenterPointCenterpoint of outer circle of gradient in relative form, 0-1 or absolute coordinates
outerradiusnumberRadius of outer circle of gradient from 0-1 or absolute coordinates
patternPatternPattern
spreadmethodSpreadMethodsSpread method defines how the gradient fills given area if gradient vector does not cover the whole area
startcolorstringStart color in CSS format
transformationTransformationGradient transformation
transformation-dxnumberX axis translation
transformation-dynumberY axis translation
transformation-xxnumberX scale
transformation-xynumberXy skew
transformation-yxnumberYx skew
transformation-yynumberY scale
unittypeGradientUnitsType of coordinated used to define gradient

Contents

Constructors

new RadialGradientStyle(startColor, endColor, innerCenter, innerRadius, outerCenter, outerRadius, transformation, unitType)

new RadialGradientStyle(startColor?, endColor?, innerCenter?, innerRadius?, outerCenter?, outerRadius?, transformation?, unitType?)

Create RadialGradientStyle

Parameters

Name Type Description
Optional startColorstring | Optionsstart color in CSS format or a properties
Optional endColorstringend color in CSS format
Optional innerCenterPointcenterpoint of inner circle of gradient in relative form, 0-1 or absolute coordinates
Optional innerRadiusnumberradius of inner circle in relative form, 0-1 or absolute coordinates
Optional outerCenterPointcenterpoint of outer circle of gradient in relative form, 0-1 or absolute coordinates
Optional outerRadiusnumberradius of outer circle of gradient from 0-1 or absolute coordinates
Optional transformationTransformationGradient transformation
Optional unitTypestringType of coordinated used to define gradient

Overrides

GradientStyle.constructor

Accessors

Empty

Static get Empty(): FillStyle

Empty style

Returns

FillStyle

Inherited from

GradientStyle.Empty


Pick

Static get Pick(): FillStyle

Pick style

Returns

FillStyle

Inherited from

GradientStyle.Pick

Methods

addStopPoint

addStopPoint(position, color): RadialGradientStyle

Add a new stop point at a given position and color.

Parameters

Name Type Description
positionnumberposition of the stop point, if in relative coordinates from 0 to 1
colorstringcolor in CSS form for specified stop point

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.addStopPoint


cleanDuplicatePoints

cleanDuplicatePoints(): RadialGradientStyle

Removes points that are identical, leaving only one

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.cleanDuplicatePoints


clearStopPoints

clearStopPoints(): RadialGradientStyle

Clear all stop points

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.clearStopPoints


clone

clone(): RadialGradientStyle

All inheritors should implement copy constructor or provide custom implementation for this method

Returns

RadialGradientStyle

this

Overrides

GradientStyle.clone


copyConstructor

Protected copyConstructor(src, deepCopy?): RadialGradientStyle

copy constructor

Parameters

Name Type Description
srcRadialGradientStyleSource to copy from
Optional deepCopybooleandeep copy

Returns

RadialGradientStyle

this

Overrides

GradientStyle.copyConstructor


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

GradientStyle.dispose


equalsTo

equalsTo(other): boolean

Returns true if fills are identical

Parameters

Name Type Description
otherFillStyleFillStyle to compare against

Returns

boolean

Inherited from

GradientStyle.equalsTo


getClassName

getClassName(): string

Returns

string

Inherited from

GradientStyle.getClassName


getColor

getColor(): string

Returns color

Returns

string

color in CSS form

Inherited from

GradientStyle.getColor


getEndColor

getEndColor(): string

Returns end color

Returns

string

color color in CSS format


getEvenOddMode

getEvenOddMode(): boolean

Gets the even odd fill mode

Returns

boolean

evenOddMode The even odd fill mode flag.

Inherited from

GradientStyle.getEvenOddMode


getForegroundColor

getForegroundColor(): string

Gets foreground color

Returns

string

color in CSS form

Inherited from

GradientStyle.getForegroundColor


getInnerCenter

getInnerCenter(): Point

Get the center of the inner circle

Returns

Point


getInnerRadius

getInnerRadius(): number

Gets inner radius

Returns

number

radius of the inner circle


getOuterCenter

getOuterCenter(): Point

Return start center in relative coordinates from 0 to 1

Returns

Point

point


getOuterRadius

getOuterRadius(): number

Return start point from 0 to 1

Returns

number

radius of outer circle of gradient from 0-1


getPattern

getPattern(context?): any

Return fill pattern. Can pass in rendering context to get HTML DOM pattern, or no arguments to get fillPattern object.

Parameters

Name Type Description
Optional contextIPatternContextnative rendering context

Returns

any

image pattern

Inherited from

GradientStyle.getPattern


getProperties

getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

An object containing the properties

Overrides

GradientStyle.getProperties


getRaster

getRaster(xMin?, yMin?, xMax?, yMax?): Raster

Returns a new instance of Raster

Parameters

Name Type Description
Optional xMinnumberx Min position to get color
Optional yMinnumbery Min position to get color
Optional xMaxnumberx Max position to get color
Optional yMaxnumbery Max position to get color

Returns

Raster

Inherited from

GradientStyle.getRaster


getRgbaColor

getRgbaColor(): RgbaColor

Return RGBA color

Returns

RgbaColor

color

Inherited from

GradientStyle.getRgbaColor


getShadow

getShadow(): Shadow

Gets all properties pertaining to shadow

Returns

Shadow

JSON with offsetX, offsetY, color and blur properties

Inherited from

GradientStyle.getShadow


getSpreadMethod

getSpreadMethod(): SpreadMethods

Returns

SpreadMethods

Inherited from

GradientStyle.getSpreadMethod


getStartColor

getStartColor(): string

Returns start color

Returns

string

color in CSS format


getStopPointColor

getStopPointColor(index): string

Return color at a stop point by index.

Parameters

Name Type Description
indexnumberindex of a stop point

Returns

string

color in CSS format, or null if index is out of range.

Inherited from

GradientStyle.getStopPointColor


getStopPointPosition

getStopPointPosition(index): number

Return stop point position

Parameters

Name Type Description
indexnumberindex of stop point

Returns

number

position either in relative or absolute terms or null if index is out of range.

Inherited from

GradientStyle.getStopPointPosition


getStopPointsCount

getStopPointsCount(): number

Return the number of defined gradient stop points

Returns

number

stops number of stops

Inherited from

GradientStyle.getStopPointsCount


getStyleType

getStyleType(): string

Return type of the style.

Returns

string

STYLE_TYPE_RADIAL_GRADIENT

Overrides

GradientStyle.getStyleType


getTimeStamp

getTimeStamp(): number

Gets time stamp

Returns

number

timeStamp

Inherited from

GradientStyle.getTimeStamp


getTransformation

getTransformation(): Transformation

Returns the transformation set on the gradient

Returns

Transformation

Inherited from

GradientStyle.getTransformation


getUnits

getUnits(): GradientUnits

Gets the type of units

Returns

GradientUnits

Inherited from

GradientStyle.getUnits


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

GradientStyle.hasEventListener


invalidate

invalidate(): RadialGradientStyle

notify the node that the style is invalidated

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.invalidate


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

GradientStyle.isDisposed


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

GradientStyle.isSilent


notify

notify<E>(type, source, args?): RadialGradientStyle

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceStyleof the event
Optional argsEventMap[E]arguments of the event

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.notify


off

off<E>(type, callback?): RadialGradientStyle

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of the event
Optional callback(eventType: E, sender: RadialGradientStyle, args: EventMap[E]) => voidfunction to be called

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.off


on

on<E>(type, callback): RadialGradientStyle

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: RadialGradientStyle, args: EventMap[E]) => voidto be called

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.on


removeStopPoint

removeStopPoint(index): RadialGradientStyle

Removes stop point at index.

Parameters

Name Type Description
indexnumberindex of the stop point

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.removeStopPoint


setColor

setColor(color): RadialGradientStyle

Sets color

Parameters

Name Type Description
colorstring | RgbaColor | HsvColor | HlsColorin CSS string form or RgbaColor object

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.setColor


setEndColor

setEndColor(color): RadialGradientStyle

Sets end color

Parameters

Name Type Description
colorstringcolor to set in CSS format

Returns

RadialGradientStyle

this


setEvenOddMode

setEvenOddMode(evenOddMode): RadialGradientStyle

Sets the even odd fill mode

Parameters

Name Type Description
evenOddModebooleanThe even odd fill mode flag.

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.setEvenOddMode


setForegroundColor

setForegroundColor(color): RadialGradientStyle

Sets foreground color

Parameters

Name Type Description
colorstring | RgbaColor | HsvColor | HlsColorRgbaColor for foreground

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.setForegroundColor


setInnerCenter

setInnerCenter(p): RadialGradientStyle

Set inner center point in relative terms

Parameters

Name Type Description
pPointpoint defining center of inner circle

Returns

RadialGradientStyle

this


setInnerRadius

setInnerRadius(r): RadialGradientStyle

Sets inner radius

Parameters

Name Type Description
rnumberRadius of inner circle

Returns

RadialGradientStyle

this


setOuterCenter

setOuterCenter(p): RadialGradientStyle

Set end point from 0 to 1

Parameters

Name Type Description
pPointend point

Returns

RadialGradientStyle

this


setOuterRadius

setOuterRadius(r): RadialGradientStyle

Set end point from 0 to 1

Parameters

Name Type Description
rnumberradius of outer circle of gradient from 0-1

Returns

RadialGradientStyle

this


setPattern

setPattern(pattern?): RadialGradientStyle

Sets fill pattern.

Parameters

Name Type Description
Optional patternPatternfill pattern

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.setPattern


setProperties

setProperties(properties?): RadialGradientStyle

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsAn object containing the properties to set

Returns

RadialGradientStyle

Overrides

GradientStyle.setProperties


setShadow

setShadow(shadow): RadialGradientStyle

Sets all properties pertaining to shadow

Parameters

Name Type Description
shadowPartial<Merge<Shadow, { color?: string | RgbaColor }>>data

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.setShadow


setSilent

setSilent(bool, force?): RadialGradientStyle

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode
Optional forcebooleantrue if parent should be invalidated immediately

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.setSilent


setSpreadMethod

setSpreadMethod(sMethod): RadialGradientStyle

Changes spread method for the gradient

Parameters

Name Type Description
sMethod"repeat" | "reflect" | "pad" | SpreadMethodsSpread method to apply to the gradient

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.setSpreadMethod


setStartColor

setStartColor(color): RadialGradientStyle

Sets start color

Parameters

Name Type Description
colorstringcolor to set

Returns

RadialGradientStyle

this


setStopPointColor

setStopPointColor(index, color): RadialGradientStyle

Sets color to a stop point by index.

Parameters

Name Type Description
indexnumberindex of a stop point
colorstringColor to set to the stop point

Returns

RadialGradientStyle

Inherited from

GradientStyle.setStopPointColor


setTransformation

setTransformation(transform): RadialGradientStyle

Sets transformation for the gradient

Parameters

Name Type Description
transformTransformationThe new gradient transformation

Returns

RadialGradientStyle

Inherited from

GradientStyle.setTransformation


setUnits

setUnits(u): RadialGradientStyle

Sets unit type for the gradient

Parameters

Name Type Description
uGradientUnitsUnit type

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.setUnits


toGrayScale

toGrayScale(clone?): FillStyle

Clone the instance in grayscale style, or convert itself if [clone] is false.

Parameters

Name Type Description
Optional clonebooleanclone instance if true, default is true

Returns

FillStyle

Inherited from

GradientStyle.toGrayScale


updateTimeStamp

updateTimeStamp(silent?): RadialGradientStyle

Update time stamp to indicate that style has been changed.

Parameters

Name Type Description
Optional silentbooleansilent mode. If this parameter equals to true then style doesn't send invalidate event

Returns

RadialGradientStyle

this

Inherited from

GradientStyle.updateTimeStamp


getClassName

Static getClassName(): string

Returns

string

Inherited from

GradientStyle.getClassName


isStyleNotificationEnabled

Static isStyleNotificationEnabled(): boolean

Return status of the global notification for all styles.

Returns

boolean

Inherited from

GradientStyle.isStyleNotificationEnabled