Skip to content

innerShadow

绘制内阴影。

关键属性

innerShadow: ShadowEffect | ShadowEffect[]

内阴影, 支持多个内阴影叠加。

ts
interface ShadowEffect {
  x: number
  y: number
  blur: number
  spread?: number
  color: Color
  blendMode?: BlendMode
  visible?: boolean
}

归属

UI

示例

绘制内阴影

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: 10,
        y: 5,
        blur: 20,
        color: '#FF0000AA'
    }
})

leafer.add(rect)

Released under the MIT License.