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

@Component({
  selector: 'sae-color-display',
  standalone: true,
  imports: [
    CommonModule
  ],
  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
    }
  }
}
