getMaterialColorsInHueOrder static method

List<BigColor> getMaterialColorsInHueOrder(
  1. List<int> weights
)

Implementation

static List<BigColor> getMaterialColorsInHueOrder(final List<int> weights) {
  final result = [];
  for (final weight in weights) {
    for (final mc in _baseMaterialColors) {
      final color = mc[weight];
      if (color == null) {
        throw WeightNotFoundException();
      }
      result.add(BigColor.fromColor(color));
    }
  }
  for (final weight in weights) {
    final color = Colors.grey[weight];
    if (color == null) {
      throw WeightNotFoundException();
    }
    result.add(BigColor.fromColor(color));
  }
  result.add(BigColor.fromColor(Colors.black));
  return List.unmodifiable(result);
}