Commits

Anonymous committed 250613a

Added slider for alpha

Comments (0)

Files changed (2)

src/ui-scripts/colorpicker.js

                    	"src", "gradient.svg"],
                   ["img", 
                    "src", "colors.svg", "class", "colors"],
+                   ["p",
+                    ["input", "type", "range", "min", "0", "max", "100", "step", "1", "value", this.initial.getSaturation(), "class", "alpha"]],
                   ["p",
                    ["input", "type", "text", "value", this.initial.getHex(), "class", "hexfield"],
                    ["input", "type", "text", "value", this.initial.getHueV(), "class", "huefield"]],
     	var swatch = ele.getElementsByClassName("selected-swatch")[0];
     	swatch.style.backgroundColor = "#" + color.getHex();
     	
+    }
+    
+    this._alpha_adjust = function(evt) {
     	
+    	alert(evt);
     	
     }
 

test-scripts/color-picker/colorpicker.html

     window.onload = function() {
         var cp = new cls.ColorPicker(null, "#FF1133");
         document.body.render(cp.render());
+        var alpha = document.getElementsByClassName("alpha");
         var slider = document.body.querySelector(".color-picker img:nth-of-type(2)");
         slider.addEventListener("click", cp._on_color_wheel_click.bind(cp), false);
         slider.addEventListener("mousemove",cp._adjust_slider.bind(cp), false);