The was.js
JavaScript / jQuery package packs some common support libraries used by various Wizardry and Steamworks assets.
Type | Function Prototype | Documentation | Description |
---|---|---|---|
jQuery | a.product(a, b) | Set-product of two arrays a and b . |
|
a.stride(n) | Returns every -th element in array a . |
||
a.chunk(n) | Splits an array a into -length chunk arrays. |
||
a.equals(b) | compare arrays | Deep-compares array a to array b . |
|
JavaScript | wasCSVToArray(csv) | Parses an RFC 4180 CSV string to an array. | |
wasArrayToCSV(a) | Dumps an array a to an RFC 4180 CSV string. |
||
wasHexToRGB(value) | Hex to RGB | Transforms a color in hexadecimal notation to an array of RGB components. | |
wasRGBToHex(r, g, b) | RGB to hex | Transforms a color in RGB notation to a hex value. | |
wasMapValueToRange(value, xMin, xMax, yMin, yMax) | map a value from a source range to a destination range | Maps a value from a source range into a destination range. |
The package can be installed using bower:
bower install --save svn+http://svn.grimore.org/was.js