Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

creative-code-toolkit

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

creative-code-toolkit

Suite of functions for creative coding

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Creative Code Toolkit

This library is my personal collection of helper functions in creative coding, revolving around modulation, array functions, random numbers, etc.

Functions

mapRange(v, a, b, c, d)

Map v in range [a, b] to range [c, d]

ParamType
vNumber
aNumber
bNumber
cNumber
dNumber

sinMap(v, div, a, b)

Map the output sin(v / div) to the range [a, b]

ParamType
vNumber
divNumber
aNumber
bNumber

cosMap(v, div, a, b)

Map the output cos(v / div) to the range [a, b]

ParamType
vNumber
divNumber
aNumber
bNumber

wrapValue(v, m, M)

if v is greater than M or less than m, wrap the value around to stay in this range

ParamType
vNumber
mNumber
MNumber

deepArrayCopy(a)

Return a deep copy array a

ParamType
aArray.<any>

genArray(s)

Create an array of size s

ParamType
sNumber

get1dY(i, rowLength)

Get the Y component of a 1d array containing 2d data when the index is i

ParamType
iNumber
rowLengthNumber

get1dX(i, rowLength)

Get the X component of a 1d array containing 2d data when the index is i

ParamType
iNumber
rowLengthNumber

choose(a)

pick a random element from the array a

ParamType
aArray.<any>

rndB(a, b)

Random number in range [a, b]

ParamType
aNumber
bNumber

rndIntB(a, b)

Random integer in range [a, b]

ParamType
aNumber
bNumber

polute()

Polutes the global scope with unnamespaced functions

FAQs

Package last updated on 20 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc