AvataaarFacialHair.random constructor

AvataaarFacialHair.random([
  1. Color? color
])

creates random AvataaarFacialHair

Implementation

factory AvataaarFacialHair.random([Color? color]) {
  final e = AvataaarFacialHair.fromIndex(
      _random.nextInt(AvataaarFacialHair.all.length));

  if (color != null) {
    return e.copyWith(color: color);
  }
  return e;
}