title: Is there a smart way to reset the color of an object?
body: <p>I am writing a program in typescript and I have <code>n</code> objects with default color red e.g. <code>cupe.material.color</code> is red.</p>
  <p>Now I want to change the color of the cube by e.g. pushing <code>ArrowUP</code>. I have no problem so far.
  The goal is when I change the color of an object x then it should reset if I set the color of another object. Only one object should have a non default color.</p>
  <p>My idea was to create a variable which saves the initial color, but this doesn't work, take a look:</p>
  <pre><code>var box1 = new THREE.Mesh(
    new THREE.BoxGeometry(),
    new THREE.MeshBasicMaterial({color:0xffffff})
  ); 
  
  var box2 = new THREE.Mesh(
    new THREE.BoxGeometry(),
    new THREE.MeshBasicMaterial({color:0xffffff})
  );
  var back;
  window.addEventListener(&quot;keydown&quot;,function(event){
     if(event.key == &quot;ArrowUp&quot;) {
        box1.material.color.set(&quot;red&quot;);
        back = box1
        
      }
      if(event.key == &quot;s&quot;) {
        box2.material.color.set(&quot;red&quot;);
        back.material.color.set(&quot;0xffffff&quot;)
        back = box2
      }
  }
  </code></pre>