2023-07-02 09:31:38 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <sal/config.h>
|
|
|
|
#include <sfx2/dllapi.h>
|
|
|
|
|
|
|
|
#include <docmodel/color/ComplexColor.hxx>
|
|
|
|
#include <docmodel/theme/ThemeColorType.hxx>
|
|
|
|
|
|
|
|
struct SFX2_DLLPUBLIC NamedColor
|
|
|
|
{
|
|
|
|
Color m_aColor;
|
|
|
|
OUString m_aName;
|
|
|
|
sal_Int16 m_nThemeIndex = -1;
|
|
|
|
sal_Int16 m_nLumMod = 10000;
|
|
|
|
sal_Int16 m_nLumOff = 0;
|
|
|
|
|
|
|
|
NamedColor() = default;
|
|
|
|
|
|
|
|
NamedColor(Color const& rColor, OUString const& rName)
|
|
|
|
: m_aColor(rColor)
|
|
|
|
, m_aName(rName)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-10-10 19:48:10 -05:00
|
|
|
model::ComplexColor getComplexColor() const
|
2023-07-02 09:31:38 -05:00
|
|
|
{
|
|
|
|
model::ComplexColor aComplexColor;
|
|
|
|
|
|
|
|
auto eThemeColorType = model::convertToThemeColorType(m_nThemeIndex);
|
|
|
|
|
|
|
|
if (eThemeColorType != model::ThemeColorType::Unknown)
|
|
|
|
{
|
2023-08-03 03:14:40 -05:00
|
|
|
aComplexColor.setThemeColor(eThemeColorType);
|
2023-07-02 09:31:38 -05:00
|
|
|
|
|
|
|
if (m_nLumMod != 10000)
|
|
|
|
aComplexColor.addTransformation({ model::TransformationType::LumMod, m_nLumMod });
|
|
|
|
|
2023-07-30 01:44:02 -05:00
|
|
|
if (m_nLumOff != 0)
|
2023-07-02 09:31:38 -05:00
|
|
|
aComplexColor.addTransformation({ model::TransformationType::LumOff, m_nLumOff });
|
2023-08-03 03:14:40 -05:00
|
|
|
|
|
|
|
aComplexColor.setFinalColor(m_aColor);
|
2023-07-02 09:31:38 -05:00
|
|
|
}
|
2023-07-29 08:48:35 -05:00
|
|
|
else
|
|
|
|
{
|
|
|
|
aComplexColor.setColor(m_aColor);
|
|
|
|
}
|
2023-07-02 09:31:38 -05:00
|
|
|
|
|
|
|
return aComplexColor;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|