Hygress Class
Hygress. A hy(potrochoid pro)gress visualisation.
Constructor
Hygress
-
[options]
Parameters:
-
[options]
Object optional- The settings.
-
[dt=1/60]
Number optional- The update rate in seconds.
-
[hypotrochoid]
Object optional- The hypotrochoid settings. If none is supplied, a random one will be created.
-
[canvas]
HTMLCanvasElement optional- The canvas to use. A new one will be created if none is supplied.
-
[clearCanvas=true]
Boolean optional- Whether the canvas should be cleared before rendering.
-
[colourRoll=true]
Boolean optional- Whether the colour should continuously change (rainbow).
-
[hue=0.0]
Number optional- The hue in degree.
-
[saturation=100.0]
Number optional- The saturation in percent.
-
[luminance=50.0]
Number optional- The luminance in percent.
-
[opacity=0.75]
Number optional- The initial opacity.
-
[scale=1.0]
Number optional- The initial scale.
-
[transitionTime=0.25]
Number optional- The initial transitionTime.
-
[size]
Array optional- The canvas size.
Item Index
Properties
Methods
draw
()
private
Draws the hypotrochoid.
update
-
elapsed
Updates the animation.
Parameters:
-
elapsed
Number- The elapsed time since the last frame in milliseconds.
Properties
_opacity
Number
private
The internal opacity transition values.
_scale
Number
private
The internal scale transition values.
colourRoll
Boolean
The hypotrochoid's colour roll flag.
htSize
Number
The hypotrochoid's size.
hue
Number
The hypotrochoid's hue in degree.
Hypotrochoid
Object
final
static
Predefined hypotrochoids.
hypotrochoid
Object
The hypotrochoid. Assigning a new object only overwrites the defined fields and keeps the other ones.
lineWidth
Number
The line width of the hypotrochoid.
luminance
Number
The hypotrochoid's luminance in percent.
opacity
Number
The opacity of the hypotrochoid. Valid values: 0.0 to 1.0.
Setting the opacity to a new value triggers a gradual change towards the target value. The transition is linear and depends on the transitionTime variable.
origin
Array
The hypotrochoid's origin.
Example:
[x, y]
saturation
Number
The hypotrochoid's saturation in percent.
scale
Number
The scale of the hypotrochoid. Valid values: 0.0 to 1.0.
Setting the scale to a new value triggers a gradual change towards the target value. The transition is linear and depends on the transitionTime variable.
size
Array
The size of the internal canvas.
Example:
[width, height]
transitionTime
Number
The transition time.
visible
Boolean
private
Visible flag, used to determine if the hypotrochoid should be drawn this frame.