import { Component , Input , ElementRef , Renderer2 , ChangeDetectionStrategy , HostBinding } from '@angular/core' ; @ Component ( { selector : '[nglColorpickerSwatch]' , templateUrl : './colorpicker-swatch.html' , changeDetection : ChangeDetectionStrategy . OnPush , } ) export class NglColorpickerSwatch { @ HostBinding ( 'style.background' ) @ Input ( ) color : string ; constructor ( private el , private renderer ) { this . renderer . addClass ( this . el . nativeElement , 'slds-swatch' ) ; } }