helper

helper

Source:

The helper module provides methods that simplify frequently used calculations and other arrangements. They can be used in every context.

Methods

(static) clone(dolly) → {*}

Source:

Simple helper to clone objects which prevents cross-linking.

Parameters:
Name Type Description
dolly *

Object to clone

Returns:

Cloned object

Type
*

(static) debugLog(…args)

Source:

Prints a formatted and colorized text to the terminal, the app was started from and sends the log to the log saving queue.

Parameters:
Name Type Attributes Description
args String | Number <repeatable>

(static) inRange(value, range) → {Boolean}

Source:

Checks if a value lies within a range of two values. Range values are included. Because it calculates the minimum and maximum value of the specified range, it does not need to be in order.

Parameters:
Name Type Description
value Number

Number to check

range Array.<Number>

Values the number should lie between

Returns:

Whether it is in the range

Type
Boolean

(static) nthParent(child, n) → {HTMLElement}

Source:

Counts n times up the DOM tree and returns it's parent

Parameters:
Name Type Description
child HTMLElement

Nested element to start with

n Number

Number of layers to go up

Returns:

The n-th parent

Type
HTMLElement

(static) shadeHexColor(hex, percent) → {String}

Source:

Takes a hex color code and changes it's brightness by the given percentage. Positive value to brighten, negative to darken a color. The function is mainly used to generate dark version of the accent colors

Parameters:
Name Type Description
hex String

Hexadecimal color code with the format #xxxxxx

percent Number

Value between -100 and 100

Returns:

Hexadecimal color code

Type
String