doodle.utils
Description:
- utils
-
Class Functions
- create_scene_path (node:Node, array:Array, clearArray:boolean) :Array
-
Creates a scene graph path from a given node and all it's descendants.
Parameters
- node:Node –
- array:Array – Array to store the path nodes in.
- clearArray:boolean – Empty array passed as parameter before storing nodes in it.
Returns
- Array – The array passed to the function (modified in place).
Throws
- TypeError –
- hex_to_rgb (color:Color) :Array
-
Parameters
- color:Color –
Returns
- Array – [r, g, b]
Throws
- TypeError –
- hex_to_rgb_str (color:Color, alpha:number) :string
-
Parameters
- color:Color –
- alpha:number –
Returns
- string –
Throws
- TypeError –
- rgb_str_to_hex (rgb:string) :string
-
Parameters
- rgb:string –
Returns
- string –
Throws
- TypeError –
- rgb_str_to_rgb (color:Color) :Array
-
Parameters
- color:Color –
Returns
- Array –
Throws
- TypeError –
- SyntaxError –
- rgb_to_hex (r:number, g:number, b:number) :string
-
Parameters
- r:number –
- g:number –
- b:number –
Returns
- string –
Throws
- TypeError –
- rgb_to_rgb_str (r:number, g:number, b:number, a:number) :string
-
Parameters
- r:number –
- g:number –
- b:number –
- a:number –
Returns
- string –
Throws
- TypeError –
- set_element_property (element:HTMLElement, property:string, value:*, type:string) :*
-
Parameters
- element:HTMLElement –
- property:string –
- value:* –
- type:string – 'css'|'html' Set CSS property or HTML attribute.
Returns
- * –
Throws
- TypeError –
- SyntaxError –
- get_style_property (element:HTMLElement, property:string, useComputedStyle:boolean) :*
-
Returns css property of element, it's own or inherited.
Parameters
- element:HTMLElement –
- property:string –
- useComputedStyle:boolean –
Returns
- * –
Throws
- TypeError –
- ReferenceError –
- get_element (element:HTMLElement|string) :HTMLElement
-
Returns HTML element from id name or element itself.
Parameters
- element:HTMLElement|string –
Returns
- HTMLElement –
- get_element_property (element:HTMLElement, property:string, returnType:string, useComputedStyle:boolean) :*
-
Returns property of an element. CSS properties take precedence over HTML attributes.
Parameters
- element:HTMLElement –
- property:string –
- returnType:string – 'int'|'float' Return type.
- useComputedStyle:boolean –
Returns
- * –
Throws
- ReferenceError –