1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
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/.
12 #include <sal/config.h>
13 #include <sfx2/dllapi.h>
15 #include <docmodel/color/ComplexColor.hxx>
16 #include <docmodel/theme/ThemeColorType.hxx>
18 struct SFX2_DLLPUBLIC NamedColor
22 sal_Int16 m_nThemeIndex
= -1;
23 sal_Int16 m_nLumMod
= 10000;
24 sal_Int16 m_nLumOff
= 0;
26 NamedColor() = default;
28 NamedColor(Color
const& rColor
, OUString
const& rName
)
34 model::ComplexColor
getComplexColor()
36 model::ComplexColor aComplexColor
;
38 auto eThemeColorType
= model::convertToThemeColorType(m_nThemeIndex
);
40 if (eThemeColorType
!= model::ThemeColorType::Unknown
)
42 aComplexColor
.setThemeColor(eThemeColorType
);
44 if (m_nLumMod
!= 10000)
45 aComplexColor
.addTransformation({ model::TransformationType::LumMod
, m_nLumMod
});
48 aComplexColor
.addTransformation({ model::TransformationType::LumOff
, m_nLumOff
});
50 aComplexColor
.setFinalColor(m_aColor
);
54 aComplexColor
.setColor(m_aColor
);
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */