C

WebGLStroke

A utility class that holds all properties of a stroke.
Inheritance Hierarchy

Remarks

The stroke that is defined by instances of this type can be applied to the WebGL2 styles like WebGLShapeNodeStyle, WebGLImageNodeStyle, WebGLGroupNodeStyle, WebGLPolylineEdgeStyle, WebGLArcEdgeStyle, WebGLBridgeEdgeStyle, WebGLLabelStyle, and WebGLIconLabelStyle.

This is a convertible type that can be used with the following notation(s) in parameter lists, parameter objects or setters.

The strings applying to this scheme are converted to WebGLStrokes:

'[thickness] [type] color'

thickness = thickness in px|thin|medium|thick
type = solid|dashed|dotted
color = CSS color strings

Valid color strings are the same as for color. Square brackets mark optional declarations.

Examples:

'3px blue'
'thick blue'

Currently, all WebGLStrokes are solid strokes. Dashed or dotted stroke patterns are not supported.

Members

No filters for this type

Constructors

Creates a new stroke with the given color and optional thickness.

Parameters

color: Color
The color for the stroke.
thickness?: number
The optional thickness, which defaults to 1.0 if not specified.
dashStyle?: WebGLDashStyle
The optional dashStyle, which defaults to SOLID. For good visual results, set lineCap to a value other than FLAT (the default).
lineCap?: WebGLLineCap
The optional lineCap, which defaults to FLAT.

Properties

Gets the color to use for the stroke.
readonlyfinal
Gets the dash style for the WebGLStroke.

The visual appearance of the 'dashes' and 'gaps' specified by this property depends on the value of the property lineCap, too.

The predefined dash styles are designed for line caps that extend into the 'gaps' like SQUARE and ROUND. With FLAT, the dashes might not look like expected, for example DOT will not be visible at all. Since FLAT is the default value, you should explicitly set another value in this case.

readonlyfinal

Property Value

The dash style.
Gets the line cap.
The line cap also affects the visual appearance of the 'dashes' and 'gaps' specified by dashStyle.
readonlyfinal
Gets the thickness to use for the stroke.
readonlyfinal

Constants

Gets a solid black stroke with thickness 1.
An invisible stroke that has no thickness or color.

Static Methods

Creates a WebGLStroke instance from the given stroke-like object by performing automatic type conversion.
static

Parameters

strokeLike: WebGLStroke
The object to convert to a WebGLStroke.

Return Value

WebGLStroke
The given strokeLike if it is already a WebGLStroke, or a new instance initialized to the values found in strokeLike.