Group Notes By Color - what determines the order?

I use colours as a way of prioritising notes. This has been working well in my saved-search overview which uses group by colour. However I want to add a new colour for lower priority notes, but notes that are set to that colour appear at the top of the overview instead of the bottom.

I had expected the group by colour to use the same order as the colours appear in the Edit Colours window, but it seems they don’t. So what does determine the grouping order?

Good question, and the honest answer is that the grouping order is not really designed at all. It falls out of how the colour is stored, which is why it does not match the Edit Colours window.

Every note stores its colour as a small piece of text. The built-in colours are stored as plain numbers, so “0”, “1”, “2” and so on in the order they appear in that window. A custom colour is different: it gets stored as its hex code with a hash in front, like “#8ECAE6”.

The grouping then just sorts those strings alphabetically. A hash sorts before any digit, so every custom colour ends up above every built-in one. That is exactly what you are seeing. It has nothing to do with priority or with where the colour sits in Edit Colours, and there is no arrangement of that window that will fix it.

It also means that if you add a second custom colour, the two will sort relative to each other by their hex codes, which is effectively arbitrary from your point of view.

So for what you are doing, a low priority group pinned to the bottom, there is no way to get there with a custom colour today. The only thing that behaves predictably is the built-in set, which sorts in the order shown in Edit Colours.

I will get this on the list. Two things really, that the sort should follow the order in Edit Colours rather than the stored text, and the reordering you asked about a while back, since the two together are what make colour usable as a priority scheme. Sorry to confirm a limitation rather than give you a workaround.

Thanks for the clear write-up, it made this quick to track down.

Thanks for the explanation! Sounds like I can at least achieve what I’m after if I stick to the built-in colours for now.

Yes, the built-in set will behave predictably, so you can build the priority ordering you want with those for now.

I will let you know when the sort gets fixed properly.