Class Style
Defined in: style.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Style()
A simple way of setting the style for a context
|
Field Attributes | Field Name and Description |
---|---|
An {Array} of colors used in gradients
|
|
Dash length used for dashed styles
|
|
Fill style
|
|
Font used
|
|
Alpha/transparency value
|
|
Composite value
|
|
Image used
|
|
An {Array} used in gradients
|
|
Line cap style
HTML5 Canvas:
The (Canvas's) lineCap property determines how the end points of every line are drawn.
|
|
Line join style
HTML5 Canvas:
The (Canvas's) lineJoin property determines how two connecting lines in a shape are joined together.
|
|
Line width
|
|
Serialization type
|
|
Shadow blur.
|
|
Shadow color.
|
|
Shadow offset x.
|
|
Shadow offset y.
|
|
Stroke/pen style
|
|
Butt cap
|
|
Round cap
|
|
Square cap
|
|
Bevel join
|
|
Mitter join
|
|
Round join
|
Method Attributes | Method Name and Description |
---|---|
clone()
|
|
equals(anotherStyle)
TODO: implement it
|
|
<static> |
Style.load(o)
Loads a style from a JSONObject
|
merge(anotherStyle)
Merge current style with another style.
|
|
setGradient(figure, value)
|
|
setupContext(context)
Setup the style of a context
|
|
toJSON()
Try not to save the properties that are null
The deleted property will be recreated and set to null while .load() method anyway
|
|
toSVG()
Transform all the style into a SVG style
|
|
transform(matrix)
|
Class Detail
Style()
A simple way of setting the style for a context
Author: Zack Newsham, Alex Gheorghiu .
Author: Zack Newsham
Field Detail
addColorStop
An {Array} of colors used in gradients
dashLength
Dash length used for dashed styles
fillStyle
Fill style
font
Font used
globalAlpha
Alpha/transparency value
globalCompositeOperation
Composite value
image
Image used
linearGradient
An {Array} used in gradients
lineCap
Line cap style
HTML5 Canvas:
The (Canvas's) lineCap property determines how the end points of every line are drawn.
There are three possible values for this property and those are: butt, round and square.
By default this property is set to butt.
- See:
- https://developer.mozilla.org/en/Canvas_tutorial/Applying_styles_and_colors#A_lineCap_example
lineJoin
Line join style
HTML5 Canvas:
The (Canvas's) lineJoin property determines how two connecting lines in a shape are joined together.
There are three possible values for this property: round, bevel and miter.
By default this property is set to miter.
- See:
- https://developer.mozilla.org/en/Canvas_tutorial/Applying_styles_and_colors#A_lineJoin_example
lineWidth
Line width
oType
Serialization type
shadowBlur
Shadow blur. Not used yet
shadowColor
Shadow color. Not used yet
shadowOffsetX
Shadow offset x. Not used yet
shadowOffsetY
Shadow offset y. Not used yet
strokeStyle
Stroke/pen style
STYLE_LINE_CAP_BUTT
Butt cap
STYLE_LINE_CAP_ROUND
Round cap
STYLE_LINE_CAP_SQUARE
Square cap
STYLE_LINE_JOIN_BEVEL
Bevel join
STYLE_LINE_JOIN_MITER
Mitter join
STYLE_LINE_JOIN_ROUND
Round join
Method Detail
clone()
equals(anotherStyle)
TODO: implement it
- Parameters:
- anotherStyle
getGradient()
<static>
Style.load(o)
Loads a style from a JSONObject
- Parameters:
- o
merge(anotherStyle)
Merge current style with another style.
If current style is missing some of other's feature it will be "enhanced" with them
Author: Zack Newsham, Alex .
Author: Zack Newsham
- Parameters:
- {Style} anotherStyle
- - the other style
setGradient(figure, value)
- Parameters:
- figure
- value
setupContext(context)
Setup the style of a context
- Parameters:
- {Context} context
- - the canvas context
toJSON()
Try not to save the properties that are null
The deleted property will be recreated and set to null while .load() method anyway
Author: Alex.
Author: Alex.
toSVG()
Transform all the style into a SVG style
Author: Alex Gheorghiu.
Author: Alex Gheorghiu
transform(matrix)
- Parameters:
- matrix