0

I'm trying to manually update a dat.gui controller. I followed the details on this page: http://workshop.chromeexperiments.com/examples/gui/#10--Updating-the-Display-Manually but it still does not work for me. Here is a sample of my code:

var ConfigData = function() {
                this.FrontColour = "#ffb752";

        };
config = new ConfigData();
var gui = new dat.gui();
var light = gui.addFolder('folder');
light.addColor( config, 'FrontColour').onChange( function(colorValue){
            externalElement.color.setHex(colorValue);
        });

Am I correct in saying I should just be able to update the variable config.FrontColour to a new colour. Then call updateDisplay() on the relevant gui.__controller for the dat.gui controller to display this new colour?

jthompson
  • 229
  • 2
  • 15

2 Answers2

4

I was trying to update the base gui controllers when I should of been updating the folder controllers ie. light.__controllers

jthompson
  • 229
  • 2
  • 15
0

Try this.FrontColour = 0xffb752;

demongolem
  • 9,474
  • 36
  • 90
  • 105
Nikita
  • 1