The custom paint requires a color argument.
class MyPaint {
static get inputArguments() { return ['<color>']; }
paint(ctx, size, styleMap) {
// Paint code goes here.
}
}
registerPaint('my-paint', MyPaint)
At present, the correct usage is background: paint(my-paint, red).
Wish there is a way to make this color argument be optional: background: paint(my-paint)