dataarts / dat.gui

Lightweight controller library for JavaScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Left border color won't change when a rgb() value passed to addColor

hijiangtao opened this issue · comments

Bug description

According to tutorial, we can use .addColor() with following approach:

var FizzyText = function() {
  this.color0 = "#ffae23"; // CSS string
  this.color1 = [ 0, 128, 255 ]; // RGB array
};

window.onload = function() {
  var text = new FizzyText();
  var gui = new dat.GUI();

  gui.addColor(text, 'color0');
  gui.addColor(text, 'color1');
};

However, the left border color will change according to user's color selection only when color variable assigned as CSS string, and it won't work in RGB array.