Preparing search index...

    Class VectorPaint

    An immutable fill paint for VectorCompositeBuilder#addPath — either a flat solid color or a VectorGradient. Create one with VectorPaint.solid or VectorPaint.gradient. A VectorPaint carries only paint (color or gradient), not path geometry, so it is freely reusable: pass the same VectorPaint to multiple VectorCompositeBuilder#addPath calls to fill several paths with one paint.

    Lens Scripting Version 370

    var builder = VectorCompositeBuilder.create(256, 256);

    // A solid red paint.
    var red = VectorPaint.solid(new vec4(0.92, 0.26, 0.21, 1.0));

    // A gradient paint, built from a VectorGradient.
    var gb = VectorGradientBuilder.linear(new vec2(0, 0), new vec2(256, 0));
    gb.addColorStop(0.0, new vec4(0.13, 0.59, 0.95, 1.0));
    gb.addColorStop(1.0, new vec4(0.30, 0.69, 0.31, 1.0));
    var sky = VectorPaint.gradient(gb.build());

    builder.addPath(trianglePath, red, VectorComposite.FillRule.NonZero);
    builder.addPath(skyPath, sky, VectorComposite.FillRule.NonZero);

    Hierarchy (View Summary)

    Index

    Methods

    • Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

      Returns string

      Lens Scripting Version 370

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean

    • Creates a solid-color paint. color is a normalized RGBA 4-component vector [r, g, b, a] with each component in [0, 1] (components outside this range are clamped).

      Parameters

      • color: vec4

        Normalized RGBA color (each component clamped to [0, 1]).

      Returns VectorPaint

      Lens Scripting Version 370