# Revision history [back]

If the colours you want to use were defined in an old palette (or by the user) and the then used names do no longer exist for your user profile the colour itself will still be shown but you don't get information about it via the dialogue. I think LibreOffice should offer a way to define a new name for an unnamed colour occurring in a document, but the palette might tend to grow rather uncontrolled this way.

To avoid persisting problems I would suggest: (1) Explicitly define your colour scheme by examples. (2) Choose named colours very similar to the original ones. (3) Apply them to the named cell styles you want to use with them. (4) If you missed to organise your colour scheme based on named styles, this might be a good opportunity to catch up to that more professional method and hence avoid direct formatting with fewer exceptions.

If you still want to explore the old colours you may use the function code (in BASIC) given below. The function used as an array expression will output the R, G, and B values in three adjacent cells of a row. You may then use this value to add a new named colour from this RGB triple to your palette. Be aware, please, of the fact that a document opened with another LibreOffice will again not contain these colour names.

Function RGBprobe(x , y, optional z)
Dim RGBarray(1 to 3)
oDoc = ThisComponent
oSheet = oDoc.Sheets(0)
'Decreasing coordinate values by 1 because BASIC starts numbering with 0.
If NOT IsMissing(z) Then oSheet = oDoc.Sheets(z-1)
oCell = oSheet.getCellByPosition(x-1,y-1)
CBkC = oCell.CellBackColor
RGBarray(1) = Red(CBkC) : RGBarray(2) = Green(CBkC) : RGBarray(3) = Blue(CBkC)
RGBprobe =RGBarray
End Function


I attach a document demonstrating how to use the function: RGBtest001.ods

If the colours you want to use were defined in an old palette (or by the user) and the then used names do no longer exist for your present user profile the colour itself will still be shown but you don't get information about it via the dialogue. I think LibreOffice should offer a way to define a new name for an unnamed colour occurring in a document, but the palette might tend to grow rather uncontrolled this way.

To avoid persisting problems I would suggest: (1) Explicitly define your colour scheme by examples. (2) Choose named colours very similar to the original ones. (3) Apply them to the named cell styles you want to use with them. (4) If you missed to organise your colour scheme based on named styles, this might be a good opportunity to catch up to that more professional method and hence avoid direct formatting with fewer exceptions.

If you still want to explore the old colours you may use the function code (in BASIC) given below. The function used as an array expression will output the R, G, and B values in three adjacent cells of a row. You may then use this value to add a new named colour from this RGB triple to your palette. Be aware, please, of the fact that a document opened with another LibreOffice will again not contain these colour names.

Function RGBprobe(x , y, optional z)
Dim RGBarray(1 to 3)
oDoc = ThisComponent
oSheet = oDoc.Sheets(0)
'Decreasing coordinate values by 1 because BASIC starts numbering with 0.
If NOT IsMissing(z) Then oSheet = oDoc.Sheets(z-1)
oCell = oSheet.getCellByPosition(x-1,y-1)
CBkC = oCell.CellBackColor
RGBarray(1) = Red(CBkC) : RGBarray(2) = Green(CBkC) : RGBarray(3) = Blue(CBkC)
RGBprobe =RGBarray
End Function


I attach a document demonstrating how to use the function: RGBtest001.ods