sort method

dynamic sort(
  1. dynamic customOpaqueSort,
  2. dynamic customTransparentSort
)

Implementation

sort(customOpaqueSort, customTransparentSort) {
  if (this.opaque.length > 1)
    this.opaque.sort(customOpaqueSort ?? painterSortStable);
  if (this.transparent.length > 1)
    this.transparent.sort(customTransparentSort ?? reversePainterSortStable);
}