How to use input.value() to set a color?

Hi, I'm trying to use the input.value() from a textbox to set a color, but I cant make it to work. Any suggestion?

var textbox ;
var paragraph;
var w = (400/5); 
var h = (60);
var tw = 40;
var cor;
function setup() {
canvas = createCanvas(401,661);
// }
textbox = createInput('0');
textbox.position (30, 75);
textbox.size (tw);
paragraph = createP('teste');
paragraph.position ((w*6) + 30, 75); 
cor = textbox.value();
}
function draw() {
background(textbox.value());
paragraph.html(textbox.value());
}

Thanks

Sign In or Register to comment.