/*eslint no-console: "off" */ import {InitializePicker} from './hsluvpicker'; export default { name: 'hsluv-picker', props: { value: { type: String, default: "#cccccc", }, nodisplay: { type: Boolean, default: false, }, displaysize: { type: String, default: 300, }, horizontal: { type: Boolean, default: false, } }, watch: { value: function(newVal){ if(newVal != this.currentcolor){ this.$refs.picker.dispatchEvent(new CustomEvent('updatecolor', {detail: newVal})); this.currentcolor = newVal; } } }, data() { return { currentcolor: "", }; }, methods: { onColorChange(event) { this.currentcolor = event.detail; this.$emit("input",event.detail); } }, mounted(){ this.currentcolor=this.value; InitializePicker(this.$refs.picker, this.value); }, template: `
H
S
L
`, };