import { Component, OnInit, OnDestroy, Input, ElementRef,Output,EventEmitter} from '@angular/core'; @Component({ selector: 'cm-color-picker', templateUrl: './colorPicker.component.html', styleUrls: ['./colorPicker.component.less'] }) export class colorPickerComponent implements OnInit { _cmcolor: string = "#3283fc"; _cmPresetColors:Array = ['#fff', '#000', '#2889e9', '#e920e9','#00afc4', '#fff500','#ff6530','#00a150','#fbc9ef','#b28850','#00ffff', 'rgb(236,64,64)']; _cmPosition:string = 'right'; _cmPositionOffset:string = "0%"; @Input() set cmcolor(cmcolor: any) { this._cmcolor = cmcolor; }; @Input() set cmPositionOffset(cmPositionOffset: any) { this._cmPositionOffset = cmPositionOffset; }; @Input() set cmPresetColors(cmPresetColors: any) { this._cmPresetColors = cmPresetColors; }; @Input() set cmPosition(cmPosition: any) { this._cmPosition = cmPosition; }; @Output() cmcolorchange = new EventEmitter(); vote(color: any) { this.cmcolorchange.emit(color) } constructor() { } ngOnInit() { } colorchange(color:any){ this.vote(color); } }