Sort by Color add-on for Google Sheets does exactly what its name suggests. It arranges your data, whether the selected range or whole rows, by the fill or font colors they contain.
Please keep in mind that the add-on doesn't process hidden, filtered & grouped cells.
Go to Extensions > Power Tools > Start to open the collection first:
Then either click on the tool icon in the toolbar:
or access the settings in the sidebar from the Process group:
If you click the icon in the toolbar, you will see a drop-down with the instantly available options to sort by color:
By default, these first 4 options sort your data in the order established by the Google Sheets palette:
To arrange the data the other way around, tick off Reverse sorting before actually initiating the sort by color in Google Sheets.
Click Advanced sorting options to access other settings.
Once you click the Advanced sorting options from the drop-down menu in the toolbar or open Sort by Color directly from the Process group, you will see the following settings in the sidebar.
The add-on follows the order from the standard Google Sheets palette. The colored line below the options always hints at the selected order and shows the main colors of the palette. All other shades, tints, and even your custom colors will also be arranged according to these main colors.
Once you're all set, hit Sort, and the add-on will sort your range in Google Sheets by fill or font colors.