summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-05-29 19:03:33 +0900
committerTomaž Vajngerl <quikee@gmail.com>2023-06-05 11:28:16 +0200
commit3daad27698f3e91f6e35ba44cd193fc892c12ec9 (patch)
tree930aa836ba0cf1d8c045922a241781bc3ca5c472 /include
parentd3cbe4c4792e94dfdef9ee54decce48cb3fa2843 (diff)
prefix aPreviousColor and aCurrentColor in SvxColorTabPage
Change-Id: I631ce120d7a2825c6d170f4b25ffefdd155e04e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152396 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit d7d2b172065f90aa2f61c0216f3722e868ae76a1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152518 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/svx/Palette.hxx31
1 files changed, 27 insertions, 4 deletions
diff --git a/include/svx/Palette.hxx b/include/svx/Palette.hxx
index ebdcb63a1377..4858b47140c4 100644
--- a/include/svx/Palette.hxx
+++ b/include/svx/Palette.hxx
@@ -16,8 +16,8 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_SVX_PALETTE_HXX
-#define INCLUDED_SVX_PALETTE_HXX
+
+#pragma once
#include <sal/config.h>
@@ -27,6 +27,9 @@
#include <tools/color.hxx>
#include <svx/svxdllapi.h>
+#include <docmodel/color/ComplexColor.hxx>
+#include <docmodel/theme/ThemeColorType.hxx>
+
class SvxColorValueSet;
struct SVXCORE_DLLPUBLIC NamedColor
@@ -43,6 +46,28 @@ struct SVXCORE_DLLPUBLIC NamedColor
: m_aColor(rColor)
, m_aName(rName)
{}
+
+ model::ComplexColor getComplexColor()
+ {
+ model::ComplexColor aComplexColor;
+
+ auto eThemeColorType = model::convertToThemeColorType(m_nThemeIndex);
+
+ if (eThemeColorType != model::ThemeColorType::Unknown)
+ {
+ aComplexColor.setSchemeColor(eThemeColorType);
+
+ if (m_nLumMod != 10000)
+ aComplexColor.addTransformation({model::TransformationType::LumMod, m_nLumMod});
+
+ if (m_nLumMod != 0)
+ aComplexColor.addTransformation({model::TransformationType::LumOff, m_nLumOff});
+ }
+
+ aComplexColor.setFinalColor(m_aColor);
+
+ return aComplexColor;
+ }
};
typedef std::function<void(const OUString&, const NamedColor&)> ColorSelectFunction;
@@ -64,6 +89,4 @@ public:
virtual Palette* Clone() const = 0;
};
-#endif // INCLUDED_SVX_PALETTE_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */