color picker in js
// color picker function;
var colorCode = '#000',
alpha = '00';
function colorPickerFunc(target, colorActive) {
colorActive ? (function () {
colorPicker.disabled = false;
colorAlpha.disabled = false;
colorPicker.oninput = function () { genareateColorFunc(this.value, colorAlpha.value) }
colorAlpha.oninput = function () { genareateColorFunc(colorPicker.value, this.value ) }
// genarate color function;
function genareateColorFunc(colorCode, alpha) {
colorCode = colorCode+ alpha;
console.log(colorCode);
}
})() : (function () {
colorPicker.disabled = true;
colorAlpha.disabled = true;
})();