Bug 394028

Summary: LabPlot does not use by default another color for the fit than for the function that is fit
Product: [Applications] LabPlot2 Reporter: uwestoehr <uwestoehr>
Component: frontendAssignee: Alexander Semke <alexander.semke>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: latest   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 2.5
Sentry Crash Report:

Description uwestoehr 2018-05-08 23:45:58 UTC
- create a new table with 2 columns
- fill the table columns with row numbers
- highlight both columns and create a new custom fit in new fit in new worksheet
- use as fit function this one
a*x^2+b
- set fit range x=10..25
- set as start value for all parameters "1"

result: the fit curve is shown as blue line which is good to distinguish it from the base curve

- now uncheck the "visible" option and check it again

result: the fit curve has now the color black. So the color is lost.
Comment 1 Alexander Semke 2018-05-09 21:25:18 UTC
Are you sure the fit curve has the blue color? You can check the color of the line in the "Line"-tab. The blue color you see is the selection color. If an object gets selected, we paint on top such a selection using the selection color of your desktop palette. If this color is blue, then the curve gets the bluish color upon selection. If you deselect the curve by selecting another object, you'll see the original color. This deselection happens also if you hide and then unhide the curve. Can you please once more on your side?
Comment 2 uwestoehr 2018-05-09 22:45:26 UTC
> The blue color you see is the selection color.

OK then the bug is that LabPlot does not use by default another color for the fit than for the function that is fit.
Comment 3 Alexander Semke 2018-05-23 08:03:15 UTC
Git commit b005ad52bdeb06d9049f336a39973db2b767ea72 by Alexander Semke.
Committed on 23/05/2018 at 08:03.
Pushed by asemke into branch 'master'.

Use different colors for different curves even if no theme with a color palette is applied.
FIXED-IN: 2.5

M  +70   -15   src/backend/worksheet/plots/cartesian/CartesianPlot.cpp

https://commits.kde.org/labplot/b005ad52bdeb06d9049f336a39973db2b767ea72
Comment 4 Alexander Semke 2018-05-23 08:06:50 UTC
(In reply to Uwe Stöhr from comment #2)
> > The blue color you see is the selection color.
> 
> OK then the bug is that LabPlot does not use by default another color for
> the fit than for the function that is fit.
We apply different colors to the curves if one of the themes with a color palette is applied to the worksheet or to the plot. I extended the code now  -  there is also a "default color palette" even if no theme was selected.