import {Component, Input, OnInit} from '@angular/core';
import {NgStyle} from '@angular/common';

@Component({
  selector: 'app-color-display',
  imports: [
    NgStyle
  ],
  templateUrl: './color-display.html',
  styleUrl: './color-display.scss'
})
export class ColorDisplay implements OnInit {
  @Input() public hexaCode: string = '#cc0000';
  @Input() public name: string = 'color name';
  @Input() public backgroundColor: string = '';

  ngOnInit() {
    if (this.hexaCode) {
      this.backgroundColor = this.hexaCode
    }
  }
}
