import { SafeUrl } from '@angular/platform-browser';
import { Component, OnInit, Input } from '@angular/core';

@Component({
  selector: 'app-avatar-pic',
  templateUrl: './avatar-pic.component.html',
  styleUrls: ['./avatar-pic.component.scss']
})
export class AvatarPicComponent implements OnInit {

  colors = ['#E6A9E6', '#F8A9CA', '#6FDCDE', '#F2D2CD', '#F2CCDB', '#BFE2F5', '#D8D0F7', '#6FDCDE', '#EC8ECC'];
  mycolor: any;
  limit = 9;
  @Input() pic: string;
  @Input() initials: string;

  constructor() { }

  ngOnInit() {
    this.randomColor(this.colors);
  }
  randomColor(c) {
    this.mycolor =  c[Math.floor(Math.random() * this.limit) + 1];
  }
}
