Two.Stop

Extends: Two.Element

Constructor

ArgumentDescription
offsetThe offset percentage of the stop represented as a zero-to-one value. Default value flip flops from zero-to-one as new stops are created.
colorThe color of the stop. Default value flip flops from white to black as new stops are created.
opacityThe opacity value. Default value is 1, cannot be lower than 0.

Index

The current index being referenced for calculating a stop's default offset value.

Properties

A list of properties that are on every Two.Stop.

fromObject

Returns: Two.Stop

ArgumentDescription
objObject notation of a Two.Stop to create a new instance

Create a new Two.Stop from an object notation of a Two.Stop.

nota-bene

Works in conjunction with Two.Stop.toObject

offset

The offset percentage of the stop represented as a zero-to-one value.

opacity

The alpha percentage of the stop represented as a zero-to-one value.

nota-bene

This is only supported on the Two.SVGRenderer. You can get the same effect by encoding opacity into rgba strings in the color.

color

The color of the stop.

copy

ArgumentDescription
stopThe reference Two.Stop

Copy the properties of one Two.Stop onto another.

clone

Returns: Two.Stop

ArgumentDescription
parentThe parent gradient to add the clone to.

Create a new instance of Two.Stop with the same properties of the current path.

toObject

Returns: Object

Return a JSON compatible plain object that represents the path.