shadow
绘制阴影、内阴影。
shadow: ShadowEffect
| ShadowEffect
[]
外阴影, 支持多个阴影叠加
innerShadow: ShadowEffect
| ShadowEffect
[]
内阴影, 支持多个阴影叠加
示例
绘制阴影
ts
import { Leafer, Rect } from 'leafer-ui'
const leafer = new Leafer({ view: window })
const rect = new Rect({
width: 100,
height: 100,
cornerRadius: 30,
fill: 'rgb(50,205,121)',
shadow: {
x: 10,
y: -10,
blur: 20,
color: '#FF0000AA'
}
})
leafer.add(rect)
绘制内阴影
ts
import { Leafer, Rect } from 'leafer-ui'
const leafer = new Leafer({ view: window })
const rect = new Rect({
width: 100,
height: 100,
cornerRadius: 30,
fill: 'rgb(50,205,121)',
innerShadow: {
x: 0,
y: 0,
blur: 20,
color: '#FF0000AA'
}
})
leafer.add(rect)