summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/tpcolor.cxx
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-01-11 08:54:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-12 17:38:53 +0100
commitd765ec2295d12ccde1fb25aa92c5d821de748add (patch)
treec2f806389478df23b78319c6043971f92995851c /cui/source/tabpages/tpcolor.cxx
parenta1d6701105456248f6ff39766a6699f26a8f3d60 (diff)
transparency->alpha in tools::Color
this just changes the Get/Set methods, the constructor and internal representation of Color is not changed. Change-Id: Idb6e07cc08bbaa5bd55b6bd4b585e648aef507b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109074 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/tabpages/tpcolor.cxx')
-rw-r--r--cui/source/tabpages/tpcolor.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 6eac86883c99..1956d0c8f86a 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -508,8 +508,8 @@ void SvxColorTabPage::ConvertColorValues (Color& rColor, ColorModel eModell)
{
case ColorModel::RGB:
{
- CmykToRgb_Impl (rColor, static_cast<sal_uInt16>(rColor.GetTransparency()) );
- rColor.SetTransparency (sal_uInt8(0));
+ CmykToRgb_Impl (rColor, static_cast<sal_uInt16>(255 - rColor.GetAlpha()) );
+ rColor.SetAlpha (255);
}
break;
@@ -517,7 +517,7 @@ void SvxColorTabPage::ConvertColorValues (Color& rColor, ColorModel eModell)
{
sal_uInt16 nK;
RgbToCmyk_Impl (rColor, nK );
- rColor.SetTransparency (static_cast<sal_uInt8>(nK));
+ rColor.SetAlpha (255 - static_cast<sal_uInt8>(nK));
}
break;
}
@@ -586,7 +586,7 @@ void SvxColorTabPage::UpdateColorValues( bool bUpdatePreset )
m_xCcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetRed() ), FieldUnit::PERCENT );
m_xMcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetBlue() ), FieldUnit::PERCENT );
m_xYcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetGreen() ), FieldUnit::PERCENT );
- m_xKcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetTransparency() ), FieldUnit::PERCENT );
+ m_xKcustom->set_value( ColorToPercent_Impl( 255 - aCurrentColor.GetAlpha() ), FieldUnit::PERCENT );
if( bUpdatePreset )
{
@@ -596,7 +596,7 @@ void SvxColorTabPage::UpdateColorValues( bool bUpdatePreset )
Application::GetSettings().GetUILanguageTag()));
m_xYpreset->set_text(unicode::formatPercent(ColorToPercent_Impl(aPreviousColor.GetGreen()),
Application::GetSettings().GetUILanguageTag()));
- m_xKpreset->set_text(unicode::formatPercent(ColorToPercent_Impl(aPreviousColor.GetTransparency()),
+ m_xKpreset->set_text(unicode::formatPercent(ColorToPercent_Impl(255 - aPreviousColor.GetAlpha()),
Application::GetSettings().GetUILanguageTag()));
}