Rac. Stroke

Stroke weight and color for drawing.

Can be used as stroke.apply() to apply the stroke settings globally, or as the parameter of drawable.draw(stroke) to apply the stroke only for that draw.

The instance applies the stroke color and weight settings in the following combinations:

  • when color = null and weight = null: a no-stroke setting is applied
  • when color is set and weight = null: only the stroke color is applied, stroke weight is not modified
  • when weight is set and color = null: only the stroke weight is applied, stroke color is not modified
  • when both color and weight are set: both stroke color and weight are applied

Constructor

new Stroke(rac, weightnullable, colornullable)

Creates a new Stroke instance.

Parameters:
Name Type Attributes Default Description
rac Rac

Instance to use for drawing and creating other objects

weight number <nullable>

The weight of the stroke, or null to skip weight

color Rac.Color <nullable>
null

A Color for the stroke, or null to skip color