huebee icon indicating copy to clipboard operation
huebee copied to clipboard

Update value even if color is not correct

Open Marfru opened this issue 3 years ago • 0 comments

Greetings,

I have an issue, I noticed that the color change function fires up only when the color is valid.

Is there a way to fire it up even if the inputted data is not a valid color?

For example, in the console.log(this.selectedColor), it only fires when the color is valid. Let's say I add #xxx87, it doesn't fire up. Is it possible to make it available even when the data is not a valid color?

if (!this.colorSelector) {
        const elem = this.$el.querySelector('.brand-color-input')
        this.colorSelector = new Huebee(elem,{
          notation: 'hex',
          saturations: 2,
        })
        this.colorSelector.on('change', (color) => {
          this.selectedColor = color
          this.colorIcon = elem.style.color
          this.$emit('input', this.selectedColor)
          console.log(this.selectedColor)
        })
      }

Marfru avatar May 09 '22 11:05 Marfru