CanvasContext.setShadow
Set the style including location of color for shadow.
Parameters
It is Object type.
Field | Type | Range | Default Value | Description |
offsetX | Number | - | 0 | The offset of the shadow from the horizontal direction of the shape |
offsetY | Number | - | 0 | The offset of the shadow from the vertical direction of the shape |
blur | Number | 0-100 | 0 | The blur level of the shadow, the larger the value, the fuzzier |
color | Color | - | black | The color of shadow |
Sample Code
copy
const ctx = my.createCanvasContext('awesomeCanvas')
ctx.setFillStyle('red')
ctx.setShadow(15, 45, 45, 'yellow')
ctx.fillRect(20, 20, 100, 175)
ctx.draw()