File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,12 +4,13 @@ function initGUIControllers(tracker) {
44 var gui = new dat . GUI ( ) ;
55
66 var trackedColors = {
7- cyan : true ,
8- magenta : true ,
9- yellow : true ,
107 custom : false
118 } ;
129
10+ Object . keys ( tracking . ColorTracker . knownColors_ ) . forEach ( function ( color ) {
11+ trackedColors [ color ] = true ;
12+ } ) ;
13+
1314 tracker . customColor = '#000000' ;
1415
1516 function createCustomColor ( value ) {
@@ -67,9 +68,12 @@ function initGUIControllers(tracker) {
6768
6869 var colorsFolder = gui . addFolder ( 'Colors' ) ;
6970
70- colorsFolder . add ( trackedColors , 'cyan' ) . onFinishChange ( updateColors ) ;
71- colorsFolder . add ( trackedColors , 'magenta' ) . onFinishChange ( updateColors ) ;
72- colorsFolder . add ( trackedColors , 'yellow' ) . onFinishChange ( updateColors ) ;
71+ Object . keys ( trackedColors ) . forEach ( function ( color ) {
72+ if ( color !== 'custom' ) {
73+ colorsFolder . add ( trackedColors , color ) . onFinishChange ( updateColors ) ;
74+ }
75+ } ) ;
76+
7377 colorsFolder . add ( trackedColors , 'custom' ) . onFinishChange ( function ( value ) {
7478 if ( value ) {
7579 this . customColorElement = colorsFolder . addColor ( tracker , 'customColor' ) . onChange ( createCustomColor ) ;
You can’t perform that action at this time.
0 commit comments