The highlighting of a Calc formula should use the colors of a default color palette and no hardcoded colors(?) and should use more different colors than now.
Andreas Kainz already mentioned this in another bug.
Copied from https://bugs.documentfoundation.org/show_bug.cgi?id=105622#c14 :
Created attachment 152862 [details] (highlight cells with chart color palette)
I would recommend to use the chart color palette cause this is defined for the same issue. Separate elements from each other.
In the image you see:
left: master build
center: standard color palette (problem colors are next to each other similar)
right: chart color palett (background saturation: 10% and brightness: 100 %)
I know the chart color palette didn't has 16, 32, 64, 128, ... different colors. For now there are only 12 colors defined, but that doesn't mean that we can't add there more colors.
When we use an color palette the colors are not hardcoded somewhere, so I think it's an good plan.
Not sure that colors are really hard-coded but even more concerned what would happen when the user/designers change the chart (or other) palette making it hard to read? If we go this way I recommend a UI test that blocks unintentional modifications later.