-1- Palettes change with time. It might be useless to try to find ou if a cells has background color ‘Red2’.
-2- Next to always attributes of the kind ‘background color’ or ‘font color’ should first be assigned to named cell styles which then can be
-2a- directly assigned to cells or
-2b- overlaid with thier attributes to cells by conditional formatting.
A formatting attribute may be used to display whether or not specific conditions are met. It should never be used to code for a relevant information. Data must be cell contents to get reliable functionality. And as soon as the data are available … See -2b-!
Regarding these facts Calc does not offer means like standard functions for introspection into cell attributes.
If you have sheets wrongly using colors to code for information, and you want to rectify them by making that information explicit in dedicated cells, you need to resort to custom code. An example for functions helping with cell introspection written in LibreOffice BASIC and making API calls you find below.
Function cellBackColor(pZ As Long, pCellAddress As String, Optional pDummy) As Long
'pDummy shall only provide a way to trigger execution depending on any reference or volatile function.'
Dim theCell As Object, bckColor As Long
On Error GoTo errorExit
theCell = ThisComponent.Sheets(pZ - 1).GetCellRangeByName(pCellAddress)
bckColor = theCell.CellBackColor
cellBackColor = bckColor
errorExit:
End Function
Function cellBackRGB(pZ As Long, pCellAddress As String, Optional pDummy) As String
'pDummy shall only provide a way to trigger execution depending on any reference or volatile function.'
Dim bckColor As Long, h As String
On Error GoTo errorExit
bckColor = cellBackColor(pZ, pCellAddress)
h = "(R,G,B) = (" & Red(bckColor) & "," & Green(bckColor) & "," & Blue(bckColor) & ")"
cellBackRGB = h
errorExit:
End Function