I have a collection of Layers where they have names and colors. What I want to do is to sort these first based on colors, then based on their names:
Layers
You're on the right track. I would create a custom collection class that inherits from Collection. In this custom collection you can override on the on insert/on delete methods and sort your collection as items are added/removed from it.