主题
Paint
A description of the style to use when drawing a shape on the canvas.
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
color | ColorValue | Colors.BLACK | The color to use when stroking or filling a shape. |
blend_mode | BlendMode | BlendMode.SRC_OVER | A blend mode to apply when a shape is drawn or a layer is composited. |
blur_image | Optional[BlurValue] | None | Blur image when drawing it on a canvas. |
anti_alias | bool | True | Whether to apply anti-aliasing to lines and images drawn on the canvas. |
gradient | Optional[PaintGradient] | None | Configures gradient paint. |
stroke_cap | StrokeCap | StrokeCap.BUTT | The kind of finish to place on the ends of stroked lines. This applies when style is STROKE. |
stroke_join | StrokeJoin | StrokeJoin.MITER | The kind of finish to place on joins between stroked segments. This applies when style is STROKE. See also: stroke_miter_limit |
stroke_miter_limit | Number | 4.0 | The limit for drawing miter joins when stroke_join is MITER and style is STROKE. If this limit is exceeded, a bevel join is used instead. |
stroke_width | Number | 0.0 | How wide stroked edges should be, in logical pixels. This applies when style is STROKE. A width of 0.0 corresponds to a hairline. |
stroke_dash_pattern | Optional[list[Number]] | None | Dash pattern used when painting stroked outlines. Values alternate between painted dash lengths and unpainted gap lengths. For example, [5, 10] paints a dash 5 logical pixels long, then leaves a gap 10 logical pixels long, repeating the pattern along the stroked path. Note: This applies only when style is STROKE. |
style | PaintingStyle | PaintingStyle.FILL | Whether to paint filled interiors or only stroked outlines. |
方法
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
copy | 'Paint' | — | 返回此对象的副本,可覆盖指定属性。 |