illuminated Class
Item Index
Methods
- createCanvasAnd2dContext static
- extend static
- extractColorAndAlpha static
- getRGBA static
- path static
Methods
createCanvasAnd2dContext
(
Object
static
-
w
-
h
Creates a canvas and context with the given width and height.
Parameters:
-
w
NumberWidth of the canvas context.
-
h
NumberHeight of the canvas context.
Returns:
Object:
An anonymous object with "canvas", "ctx", "w" and "h"
properties.
extend
(
static
-
mergeInto
-
mergeFrom
Merges the properties from the given parameters into the first parameter.
Parameters:
-
mergeInto
ObjectAn object to merge into.
-
mergeFrom
Object multipleObjects to merge from.
extractColorAndAlpha
(
Object
static
-
color
Converts a CSS color string into an anonymous object with color and alpha properties.
Parameters:
-
color
StringColor in any CSS format.
Returns:
Object:
An anonymous object with the properties color and alpha.
The color property is a string in hex format and the alpha property is a
number from 0.0 to 1.0, rounded to 3 decimal places.
getRGBA
(
String
static
-
color
-
alpha
Converts a CSS color string into RGBA format.
Parameters:
-
color
StringColor in any CSS format.
-
alpha
NumberAlpha value for produced color.
Returns:
String:
Color in RGBA format.
path
(
static
-
ctx
-
points
-
dontJoinLast
Draw a path defined by the given points onto the given ctx.
Parameters:
-
ctx
CanvasRenderingContext2DThe context onto which the properties should be drawn.
-
points
ArrayAn array of illuminated.Vec2 objects that define the path.
-
dontJoinLast
BooleanTrue if the last point should joined with the first point in the path.