diff options
-rw-r--r-- | chart2/source/view/main/VDataSeries.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index efc5333ca00b..2ebe5f5d6711 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -1106,6 +1106,18 @@ double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropN if(mpOldSeries && mpOldSeries->hasPropertyMapping(rPropName)) { double fOldValue = mpOldSeries->getValueByProperty( nIndex, rPropName ); + if(rPropName.endsWith("Color")) + { + //optimized interpolation for color values + Color aColor(static_cast<sal_uInt32>(fValue)); + Color aOldColor(static_cast<sal_uInt32>(fOldValue)); + sal_uInt8 r = aOldColor.GetRed() + (aColor.GetRed() - aOldColor.GetRed()) * mnPercent; + sal_uInt8 g = aOldColor.GetGreen() + (aColor.GetGreen() - aOldColor.GetGreen()) * mnPercent; + sal_uInt8 b = aOldColor.GetBlue() + (aColor.GetBlue() - aOldColor.GetBlue()) * mnPercent; + sal_uInt8 t = aOldColor.GetTransparency() + (aColor.GetTransparency() - aOldColor.GetTransparency()) * mnPercent; + Color aRet(t, r, g, b); + return aRet.GetColor(); + } return fOldValue + (fValue - fOldValue) * mnPercent; } return fValue; |