apply method

List<ColorToken> apply({
  1. List<ColorToken>? colors,
  2. bool mergeColors = true,
})

Implementation

List<ColorToken> apply({List<ColorToken>? colors, bool mergeColors = true}) {
  if (mergeColors && colors != null) {
    final map = {for (final color in this) color.name: color, for (final color in colors) color.name: color};
    return map.values.toList();
  } else {
    return colors ?? this;
  }
}