LibreOffice Module sfx2 (master) 1
namedcolor.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#pragma once
11
12#include <sal/config.h>
13#include <sfx2/dllapi.h>
14
17
19{
21 OUString m_aName;
22 sal_Int16 m_nThemeIndex = -1;
23 sal_Int16 m_nLumMod = 10000;
24 sal_Int16 m_nLumOff = 0;
25
26 NamedColor() = default;
27
28 NamedColor(Color const& rColor, OUString const& rName)
29 : m_aColor(rColor)
30 , m_aName(rName)
31 {
32 }
33
35 {
36 model::ComplexColor aComplexColor;
37
38 auto eThemeColorType = model::convertToThemeColorType(m_nThemeIndex);
39
40 if (eThemeColorType != model::ThemeColorType::Unknown)
41 {
42 aComplexColor.setSchemeColor(eThemeColorType);
43
44 if (m_nLumMod != 10000)
45 aComplexColor.addTransformation({ model::TransformationType::LumMod, m_nLumMod });
46
47 if (m_nLumMod != 0)
48 aComplexColor.addTransformation({ model::TransformationType::LumOff, m_nLumOff });
49 }
50
51 aComplexColor.setFinalColor(m_aColor);
52
53 return aComplexColor;
54 }
55};
56
57/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
void setSchemeColor(ThemeColorType eType)
void setFinalColor(Color const &rColor)
void addTransformation(Transformation const &rTransform)
Color m_aColor
#define SFX2_DLLPUBLIC
Definition: dllapi.h:29
constexpr ThemeColorType convertToThemeColorType(sal_Int32 nIndex)
OUString m_aName
model::ComplexColor getComplexColor()
Definition: namedcolor.hxx:34
OUString m_aName
Definition: namedcolor.hxx:21
Color m_aColor
Definition: namedcolor.hxx:20
NamedColor()=default
NamedColor(Color const &rColor, OUString const &rName)
Definition: namedcolor.hxx:28