Skip to content

SolidPaint 对象

纯色填充对象, 可设置给 fillstroke 属性。

关键属性

type: string

填充类型为 solid

color: Color

颜色。

基础属性

blendMode?: BlendMode

混合模式,默认为 normal。

visible?: boolean

是否可见,默认为 true。

opacity?: number

不透明度,默认为 1,暂时仅针对 color 为 颜色对象 有效。

子描边属性

style?: IStrokeStyle

当为元素设置多个描边时,可设置子描边样式 style ,用于覆盖 主描边样式

可形成蚂蚁线、模拟内中外三层描边等各种效果,了解具体设置

归属

UI 元素

示例

ts
// #纯色填充
import { Leafer, Rect } from 'leafer-ui'

const leafer = new Leafer({ view: window })

const rect = new Rect({
    width: 100,
    height: 100,
    fill: {
        type: 'solid',
        color: '#32cd79'
    },
})

leafer.add(rect)

Released under the MIT License.