Bug 125329 - Automatic font color becomes invisible on resize of Calc charts with dark background
Summary: Automatic font color becomes invisible on resize of Calc charts with dark bac...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Chart Options-Dialog-Colours
  Show dependency treegraph
Reported: 2019-05-17 00:34 UTC by Cathy Crumbley
Modified: 2021-07-16 10:41 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:

data for testing chart (21.33 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-05-17 00:36 UTC, Cathy Crumbley

Note You need to log in before you can comment on or make changes to this bug.
Description Cathy Crumbley 2019-05-17 00:34:38 UTC
Observed in versions and

To reproduce the problem:

Go to Tools > Options  > Application Colors  
Under Document background, select Dark Gray 3 and click OK
Select data for chart (example data attached) and ensure that font color is Automatic
Click on Chart Wizard icon in the Standard toolbar
Select any chart type
Click Finish
Click outside chart to leave edit mode
Click chart to select it
Click and drag a selection handle to increase or decrease chart size 

Expected result:
The font color in the chart axis labels and legend is black 

The font color in the chart changes from black to white when the chart size is changed. Because the chart background is white, the white text becomes invisible.
Comment 1 Cathy Crumbley 2019-05-17 00:36:46 UTC
Created attachment 151473 [details]
data for testing chart
Comment 2 BogdanB 2019-05-17 16:07:28 UTC
I could reproduce this on Linux 6.2

Build ID: aecc05fe267cc68dde00352a451aa867b3b546ac
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 3 BogdanB 2019-05-17 16:13:17 UTC
With the mention that text is first black, but after going outside of the chart and resize it the font color change...To automatic which in this case became WHITE.

Reproduce also on

Build ID: 96ab20756316b25b7f2343a15596bc5114ea5a68
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-05-02_14:29:16
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 4 Timur 2020-04-01 07:12:45 UTC
No repro 4.0, usign Appearance and darkest grey. Repro 4.2 with Grey 10. Regression. Repro 7.0+.
Comment 5 Timur 2020-05-11 09:21:26 UTC
Bibisect with 41max: 7019e8654514116303a57895f660b5f3a39f364f is the first bad commit
commit 7019e8654514116303a57895f660b5f3a39f364f
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Fri Sep 18 10:43:03 2015 +0800

    commit 77e21bb36a2cdaaa0f4049dee0d45c5b2325c6e9
    Author:     Luke Deller <luke@deller.id.au>
    AuthorDate: Sat Mar 9 01:26:56 2013 +1100
    Commit:     Fridrich Strba <fridrich@documentfoundation.org>
    CommitDate: Mon Mar 11 14:54:57 2013 +0000
        Change definition of "dark" colour for fdo#61993

Previous source-hash-b0dec5f73dbfe2ca1db2fec6d3e84472f2b62a3f. Single commit. 


I'm not sure if Luke is active, but I'll add in CC to see.
Comment 6 Luke Deller 2020-05-20 13:25:06 UTC
Thanks Timur.

This commit 77e21bb36a2cdaaa0f4049dee0d45c5b2325c6e9 simply changes the threshold at which a colour is considered "dark".

When I revert the change in commit 77e21bb36a2cdaaa0f4049dee0d45c5b2325c6e9 upon latest git master, I can still reproduce the problem using a document background of "Dark Grey 3" (red=28,green=28,blue=28).

I suspect your bibisection was using a slightly lighter colour?  Would it be possible to repeat bibisection with a darker colour?

In terms of debugging the underlying problem, I notice that the decision to use a white font comes from editeng/source/editeng/impedit3.cxx ImpEditEngine::GetAutoColor()
(because if I change that to return COL_LIGHTRED instead of COL_WHITE then try to reproduce this bug, the font color in the chart axis label becomes light red when I resize the chart).
This wrong decision appears to be because it is referring to background colour of the ImpEditEngine instance which is different from the background colour of the chart.
Comment 7 Timur 2021-07-16 10:41:39 UTC
Another bibisect in 4.1 with 80% grey gives the same result.