How to use the vue-color.Sketch function in vue-color

To help you get started, we’ve selected a few vue-color examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stream-labs / streamlabs-obs / app / components / obs / inputs / ObsColorInput.vue.ts View on Github external
import { Component, Watch, Prop } from 'vue-property-decorator';
import { debounce } from 'lodash-decorators';
import { TObsType, IObsInput, ObsInput } from './ObsInput';
import Utils from '../../../services/utils';
import VueColor from 'vue-color';

interface IColor {
  r: number;
  g: number;
  b: number;
  a: number;
}

@Component({
  components: { ColorPicker: VueColor.Sketch },
})
class ObsColorInput extends ObsInput> {
  static obsType: TObsType;

  @Prop()
  value: IObsInput;

  pickerVisible = false;

  togglePicker() {
    this.pickerVisible = !this.pickerVisible;
  }

  @debounce(500)
  setValue(rgba: IColor) {
    if (!Object.keys(rgba).every(key => rgba[key] === this.obsColor[key])) {

vue-color

Color of Vue Components

MIT
Latest version published 4 years ago

Package Health Score

59 / 100
Full package analysis