getPaint method

Paint getPaint([
  1. T? paintId
])

Gets a paint from the collection.

Returns the main paint if no paintId is provided.

Implementation

Paint getPaint([T? paintId]) {
  if (paintId == null) {
    return this.paint;
  }

  final paint = _paints[paintId];

  if (paint == null) {
    throw ArgumentError('No Paint found for $paintId');
  }

  return paint;
}