To set the width of the stroke, use ctx.setLineWidth(double)
In general, FillStrokeStyle currently has three subclasses:
- CanvasGradient
- CanvasPattern
- CssColor
They don't have public constructors. CanvasGradient can be created by using ctx.createLinearGradient() or ctx.createRadialGradient().
CanvasPatterns can be created with ctx.createPattern().
CssColors can be created with CssColor.make(). There's also a shortcut: A CssColor object is created in the background, when you use some of the overloaded methods of Context2d like ctx.setStrokeStyle(String color) or ctx.setFillStyle(String color).