summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-01-23 16:06:22 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-06-13 21:00:33 +0100
commit6c9b376b2dc9007f1cb48a189f3020a1b82937fd (patch)
tree347618eeddf60bc3444370c5eed392dd8d4ec814 /svtools
parent0061af795047deb92c4b43ec191ad6ffd97d0b64 (diff)
Resolves: #i121532# unified getting the blended selection color
(cherry picked from commit dd4bed5d1151db2a45dbbfe9eff61875f8f4835d) Conflicts: svtools/inc/svtools/optionsdrawinglayer.hxx svtools/source/config/optionsdrawinglayer.cxx sw/source/core/crsr/viscrs.cxx Change-Id: I21167b58a9b81f5fa15c7def5fb4b6023f91f32b
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/config/optionsdrawinglayer.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/svtools/source/config/optionsdrawinglayer.cxx b/svtools/source/config/optionsdrawinglayer.cxx
index 025a2bc4e92c..31a84c28e4e6 100644
--- a/svtools/source/config/optionsdrawinglayer.cxx
+++ b/svtools/source/config/optionsdrawinglayer.cxx
@@ -1229,6 +1229,27 @@ sal_uInt16 SvtOptionsDrawinglayer::GetSelectionMaximumLuminancePercent() const
return aRetval;
}
+Color SvtOptionsDrawinglayer::getHilightColor() const
+{
+ Color aRetval(Application::GetSettings().GetStyleSettings().GetHighlightColor());
+ const basegfx::BColor aSelection(aRetval.getBColor());
+ const double fLuminance(aSelection.luminance());
+ const double fMaxLum(GetSelectionMaximumLuminancePercent() / 100.0);
+
+ if(fLuminance > fMaxLum)
+ {
+ const double fFactor(fMaxLum / fLuminance);
+ const basegfx::BColor aNewSelection(
+ aSelection.getRed() * fFactor,
+ aSelection.getGreen() * fFactor,
+ aSelection.getBlue() * fFactor);
+
+ aRetval = Color(aNewSelection);
+ }
+
+ return aRetval;
+}
+
namespace
{
class theOptionsDrawinglayerMutex : public rtl::Static<osl::Mutex, theOptionsDrawinglayerMutex>{};