color picker in js

Solutions on MaxInterview for color picker in js by the best coders in the world

showing results for - "color picker in js"
Juan Pablo
24 Nov 2017
1    //    color picker function;
2    var colorCode = '#000',
3        alpha = '00';
4    function colorPickerFunc(target, colorActive) {
5        colorActive ? (function () {
6            colorPicker.disabled = false;
7            colorAlpha.disabled = false;
8            colorPicker.oninput = function () { genareateColorFunc(this.value, colorAlpha.value) }
9            colorAlpha.oninput = function () { genareateColorFunc(colorPicker.value, this.value ) }
10            // genarate color function;
11            function genareateColorFunc(colorCode, alpha) {
12                colorCode = colorCode+ alpha;
13                console.log(colorCode);                
14            }
15
16        })() : (function () {
17            colorPicker.disabled = true;
18            colorAlpha.disabled = true;
19        })();
Paulina
25 Jan 2018
1<input type="color" value="#ff0000">