The generated matrix can be hard to read if you don't put care into the order in which you add values to the palette. Add a toggle to the first cell of the matrix to toggle between "Palette order" and "Luminance order", which should resolve the need to manually order content
context
Example palette shows this. In this case, the query param ordering is a result of unordered extraction from another data source via Object.keys().