Skip to content

textmode.js / Textmodifier / stroke

Method: stroke()

Call Signature

ts
stroke(): TextmodeColor;

Alias for charColor. Current stroke (character) color.

Returns

TextmodeColor

Current character color.

Example

Call Signature

ts
stroke(gray, alpha?): void;

Alias for charColor. Set the stroke (character) color using a grayscale value.

Parameters

ParameterTypeDescription
graynumberGrayscale value (0-255)
alpha?numberOptional alpha value (0-255)

Returns

void

Example

Call Signature

ts
stroke(
   r, 
   g, 
   b, 
   a?): void;

Alias for charColor. Set the stroke (character) color using RGB(A) values.

Parameters

ParameterTypeDescription
rnumberRed component (0-255)
gnumberGreen component (0-255)
bnumberBlue component (0-255)
a?numberOptional alpha component (0-255)

Returns

void

Example

Call Signature

ts
stroke(value): void;

Alias for charColor. Set the stroke (character) color using a CSS string or TextmodeColor object.

Parameters

ParameterTypeDescription
value| string | TextmodeColorHex string, rgb()/rgba() string, or an existing color object

Returns

void

Example