letctx = canvas.getContext('2d');/* 字体样式 */ctx.font="bold italic 100px arial"; ctx.shadowColor="#bbb"; ctx.shadowBlur=10; ctx.shadowOffsetX=20; ctx.shadowOffsetY=20;/* 字体渐变 */letlingrad = ctx.createLinearGradient(20,0,400,100); lingrad.addColorStop(0,'red'); lingrad....
const colors = ['red', 'blue']; canvaSketcher.sketch('div', ['first', 'second'], document) .style('background-color', function(data: string, i: number) { // here, "this" stands for the SketcherHTMLElement if(this.classList.contains("keep-red")) return 'red; return colors[i]...
shadowBlur: 2, shadowColor: 'rgba(0, 0, 0, 0.8)' }) .drawRect({ layer: true, draggable: true, bringToFront: true, name: 'redSquare', fillStyle: 'red', x: 190, y: 100, width: 100, height: 100, rotate: 130, shadowX: -2, shadowY: 5, shadowBlur: 3, shadowColor: 'rgba(0...