I'm using TextInput boxes for users to put in numbers and for my code to output new numbers but when I go to click the button to make the calculations and output nothing happens. Each box has an instance name and my button is labeled. Can you tell me what the problem may be?
My goal is to mix 2 RGB colors to make a new RBG color. Here is my code:
var r1 = this.r1;
var g1 = this.g1;
var b1 = this.b1;
var r2 = this.r2;
var g2 = this.g2;
var b2 = this.b2;
var r3 = this.r3;
var g3 = this.g3;
var b3 = this.b3;
this.blend_btn.addEventListener("click", Blending);
function Blending(evt)
{
if (r1 >= 0 && r1 <=255)
{
r3 = Math.round((r1.text + r2.text)/2);
r3.text = String(r3);
}
if (g1 >= 0 && g1 <=255)
{
g3 = Math.round((g1.text + g2.text)/2);
g3.text = String(g3);
}
if (b1 >= 0 && b1 <=255)
{
b3 = Math.round((b1.text + b2.text)/2);
b3.text = String(b3);
}
}