Skip to content

Stroke Color

The strokeColor defines the color used for the stroke function.

Example

ts
const ctx = node.getComponent(Graphics);
ctx.lineWidth = 2;
ctx.strokeColor = hexToColor('#0000ff');
ctx.rect(20,20,250,200);
ctx.stroke();

strokeColor.png


Return to the Graphics Component Reference documentation.