Paint class

A solid color, gradient, or image texture that can be applied as fills or strokes.

Available Extensions
Annotations
  • @JsonSerializable()
  • @CopyWith()

Constructors

Paint({PaintType? type, required bool visible, double? opacity, Color? color, BlendMode? blendMode, List<Vector2D>? gradientHandlePositions, List<ColorStop>? gradientStops, ScaleMode? scaleMode, List<List<num>>? imageTransform, num? scalingFactor, String? imageRef, String? gifRef})
Paint.fromJson(Map<String, dynamic> json)
factory

Properties

blendMode BlendMode?
How this node blends with nodes behind it in the scene.
final
color Color?
Solid color of the paint.
final
gifRef String?
A reference to the GIF embedded in this node, if the image is a GIF. To download the image using this reference, use the FigmaClient.getImages() method to retrieve the mapping from image references to image URLs.
final
gradientHandlePositions List<Vector2D>?
This field contains three vectors, each of which are a position in normalized object space (normalized object space is if the top left corner of the bounding box of the object is (0, 0) and the bottom right is (1,1)). The first position corresponds to the start of the gradient (value 0 for the purposes of calculating gradient stops), the second position is the end of the gradient (value 1), and the third handle position determines the width of the gradient. See image examples:
final
gradientStops List<ColorStop>?
Positions of key points along the gradient axis with the colors anchored there. Colors along the gradient are interpolated smoothly between neighboring gradient stops.
final
hashCode int
The hash code for this object.
no setterinherited
imageRef String?
A reference to an image embedded in this node. To download the image using this reference, use the FigmaClient.getImages() method to retrieve the mapping from image references to image URLs.
final
imageTransform List<List<num>>?
Affine transform applied to the image, only present if scaleMode is ScaleMode.stretch.
final
opacity double?
Overall opacity of paint (colors within the paint can also have opacity values which would blend with this).
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaleMode ScaleMode?
Image scaling mode.
final
scalingFactor num?
Amount image is scaled by in tiling, only present if scaleMode is ScaleMode.tile.
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
type PaintType?
Type of paint as a string enum.
final
visible bool
Whether or not the paint is enabled.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited