Created
March 5, 2018 22:02
-
-
Save lonekorean/1b08cd66fed0875679be4e39fb57f302 to your computer and use it in GitHub Desktop.
Solid color paint worklet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SolidColorPainter { | |
static get inputArguments() { | |
return ['<color>']; | |
} | |
paint(ctx, size, props, args) { | |
ctx.fillStyle = args[0].toString(); | |
ctx.fillRect(0, 0, size.width, size.height); | |
} | |
} | |
registerPaint('solid-color', SolidColorPainter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment