@Mike 'Pomax' Kamermans made some great points that i would like to expand on a couple of points so they really hit home for all readers!
One of the powerful features of JavaScript is its dynamic, typeless nature. Where typed languages like Java, and therefore Processing, can reuse names without fear of ambiguity (method overloading), Processing.js cannot. Without getting into the inner-workings of JavaScript, the best advice for Processing developers is to not use function/class/etc. names as variable names.
As Mike said above one major problem is that HTML id attributes cannot start with a number! This is actually the case in most programming languages with var names etc. so a very good one to note.
A big issue you are having is you are trying to convert a string of numbers into their hex value equivalent with this code:
function getColor(){ var hex = parseInt(color, 16) return hex;
}
ParseInt will convert strings of various base types to INTS
So your hex colors are not in the form
color val = #123456
but instead just
color val = 123456
You can read more here about parseInt if that didn't make sense:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
I would try this
Within the processing.js file:
function getColor() {
return color;
}
This will just pass the string with the color swatch to your setFrameColor function to work on it.
function setFrameColor() {
var hex = javascript.getColor();
// hex is of the form #RRGGBB
frameColor = color( unhex(hex.substring(1,3)),
unhex(hex.substring(3,4)),
unhex(hex.substring(5,6)) );
}
Unhex converts a String representation of a hexadecimal number to its equivalent integer value - so here we are breaking up our string using substring() into it's 3 RGB values and you can now use color(r, g, b) as Mike suggested.
For more on Unhex: http://processingjs.org/reference/unhex_/