Constructor
new Stroke(rac, weightnullable, coloropt, nullable)
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 |
|
color |
Rac.Color
|
<optional> <nullable> |
null |
A |
Members
rac :Rac
Instance of Rac used for drawing and passed along to any created
object.
Methods
(static) from(rac, something) → {Rac.Stroke}
Returns a Stroke derived from something.
- When
somethingis an instance ofStroke, returns that same object. - When
somethingis an instance ofColor, returns a newStrokeusingsomethingascolorand anullstroke weight. - When
somethingis an instance ofFill, returns a newStrokeusingfill.colorand anullstroke weight. - Otherwise an error is thrown.
Parameters:
| Name | Type | Description |
|---|---|---|
rac |
Rac
|
Instance to pass along to newly created objects |
something |
Rac.Stroke
|
Rac.Color
|
Rac.Fill
|
An object to
derive a |
appendFill(someFill) → {Rac.StyleContainer}
Returns a new StyleContainer containing this and the Fill
derived from someFill.
- See:
Parameters:
| Name | Type | Description |
|---|---|---|
someFill |
Rac.Fill
|
Rac.Color
|
Rac.Stroke
|
An object to derive
a |
appendStyle(style) → {Rac.StyleContainer|Rac.Stroke}
Returns a new StyleContainer containing this and style. When
style is null, returns this instead.
Parameters:
| Name | Type | Description |
|---|---|---|
style |
Rac.Stroke
|
Rac.Fill
|
Rac.StyleContainer
|
A style object
to contain along |
container() → {Rac.StyleContainer}
Returns a new StyleContainer containing only this.
withAlpha(newAlpha) → {Rac.Stroke}
Returns a new Stroke with a copy of color setup with newAlpha,
and the same stroke as this.
When this.color is set to null, returns a new Stroke that is a
copy of this.
Parameters:
| Name | Type | Description |
|---|---|---|
newAlpha |
number
|
The alpha channel of the |
withWeight(newWeightnullable) → {Rac.Stroke}
Returns a new Stroke with weight set to newWeight.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
newWeight |
number
|
<nullable> |
The weight of the stroke, or |