color picker js

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

showing results for - "color picker js"
Ryan
13 Apr 2018
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        })();
Alexander
27 Jan 2020
1<input type="color" value="#ff0000">