Release 0.1 for my processing.js work


I’ve hit the point that it’s time to release some of my work.  So here is a detailed run down of what I’ve been working on and where my progress is at.


  • shorten( array ) – receives an array and shortens it by one element and then returns a copy of the array.  shorten test
  • expand( array, newSize ) – receives an array and optionally a newSize to make the array.  expands the array to double its original length by default or expands the array to the newSize if specified. expand test
  • unhex( str ) – receives a 8 character hex string that represents a color.  unhex returns an int that represents that hex value as a signed int value. unhex text
  • nfs( num, left, right ) – number format string accepts either an int, float, int[], or float[] and a number of digits to show on the left of the decimal and optionally a number of digits to show on the right of the decimal place.  nfs test

Bug Fixes:

  • fill( num ) – fill is designed to take 1 number argument in the range of 0 to 255 for shades of grey.  However the java processing native client allows you to pass in an int value representing a color and it will fill with that color.  fill( num ) for pjs did not currently support a single number argument for values outside the 0 – 255 range.  I added this because the native java client for processing does support it even though the reference for processing in java doesn’t specify it should work this way.  example test
  • nf( num, pad ) – This function was causing an infinite loop script crash in Firefox when called with certain numbers.  I’ve added a fix for the crash but this function still needs to have code written to support 3 arguments. example test

I had planned to implement nfc() as well for this release but I ran out of time so it will make it into 0.2 in November.  The bug fixes for fill() and nf() were unplanned though so I don’t feel as though I didn’t achieve my goal for this release.

My wiki page contains the code snippets for each function and I’ll be adding my entire set of code changes with the 2 bug fixes to the repository code which F1lt3r updated yesterday.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s