[Libreoffice-commits] core.git: chart2/source compilerplugins/clang cui/source dbaccess/source desktop/source drawinglayer/source editeng/source emfio/source extensions/source filter/qa filter/source forms/source include/oox include/sax include/svx include/tools include/vcl oox/source reportdesign/source sc/qa sc/source sd/source sfx2/source starmath/inc starmath/source svtools/source svx/source sw/qa sw/source toolkit/source tools/qa UnoControls/source vbahelper/source vcl/headless vcl/inc vcl/qa vcl/qt5 vcl/skia vcl/source vcl/unx writerfilter/source xmloff/source

Noel (via logerrit) logerrit at kemper.freedesktop.org
Sat Jan 16 09:07:58 UTC 2021


 UnoControls/source/controls/progressbar.cxx                        |    4 
 UnoControls/source/inc/progressbar.hxx                             |    8 
 UnoControls/source/inc/progressmonitor.hxx                         |    4 
 UnoControls/source/inc/statusindicator.hxx                         |    6 
 chart2/source/controller/dialogs/DataBrowser.cxx                   |    8 
 chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx       |    4 
 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx |    2 
 chart2/source/controller/main/ChartController_Tools.cxx            |    2 
 chart2/source/controller/sidebar/ChartAreaPanel.cxx                |    2 
 chart2/source/view/main/VDataSeries.cxx                            |    8 
 compilerplugins/clang/colorcheck.cxx                               |   95 ++++++
 cui/source/options/cfgchart.cxx                                    |    2 
 cui/source/tabpages/tpcolor.cxx                                    |    2 
 dbaccess/source/ui/misc/TokenWriter.cxx                            |   15 -
 desktop/source/splash/splash.cxx                                   |    2 
 drawinglayer/source/primitive2d/sceneprimitive2d.cxx               |   10 
 drawinglayer/source/tools/emfpbrush.cxx                            |   18 -
 drawinglayer/source/tools/emfphelperdata.cxx                       |    4 
 editeng/source/accessibility/AccessibleEditableTextPara.cxx        |    8 
 editeng/source/items/frmitems.cxx                                  |    8 
 editeng/source/items/textitem.cxx                                  |    8 
 editeng/source/uno/unonrule.cxx                                    |    6 
 emfio/source/reader/mtftools.cxx                                   |    2 
 extensions/source/propctrlr/fontdialog.cxx                         |    4 
 extensions/source/propctrlr/standardcontrol.cxx                    |    2 
 filter/qa/cppunit/msfilter-test.cxx                                |    2 
 filter/source/graphicfilter/ieps/ieps.cxx                          |    2 
 filter/source/graphicfilter/itga/itga.cxx                          |    2 
 filter/source/msfilter/escherex.cxx                                |    8 
 forms/source/component/Grid.cxx                                    |    2 
 forms/source/component/navigationbar.cxx                           |    4 
 include/oox/helper/helper.hxx                                      |    2 
 include/sax/tools/converter.hxx                                    |   10 
 include/svx/ColorSets.hxx                                          |    2 
 include/svx/colorwindow.hxx                                        |    2 
 include/tools/color.hxx                                            |   38 ++
 include/vcl/BitmapColor.hxx                                        |   18 +
 include/vcl/RawBitmap.hxx                                          |    2 
 include/vcl/salgtype.hxx                                           |    2 
 oox/source/drawingml/chart/objectformatter.cxx                     |    4 
 oox/source/drawingml/color.cxx                                     |    8 
 oox/source/drawingml/shape.cxx                                     |    4 
 oox/source/export/chartexport.cxx                                  |    8 
 oox/source/export/drawingml.cxx                                    |   22 -
 oox/source/export/shapes.cxx                                       |    2 
 oox/source/ole/olehelper.cxx                                       |    2 
 reportdesign/source/core/api/ImageControl.cxx                      |    2 
 reportdesign/source/core/api/Section.cxx                           |    2 
 reportdesign/source/ui/dlg/Condition.cxx                           |    4 
 reportdesign/source/ui/misc/UITools.cxx                            |    6 
 reportdesign/source/ui/report/FixedTextColor.cxx                   |    6 
 reportdesign/source/ui/report/ReportController.cxx                 |    4 
 reportdesign/source/ui/report/ReportSection.cxx                    |    4 
 sc/qa/extras/new_cond_format.cxx                                   |    2 
 sc/source/core/tool/appoptio.cxx                                   |    8 
 sc/source/core/tool/viewopti.cxx                                   |    7 
 sc/source/filter/excel/xestream.cxx                                |    2 
 sc/source/filter/excel/xestyle.cxx                                 |    2 
 sc/source/filter/excel/xlchart.cxx                                 |    4 
 sc/source/filter/ftools/fapihelper.cxx                             |    4 
 sc/source/filter/inc/condformatbuffer.hxx                          |    2 
 sc/source/filter/oox/condformatbuffer.cxx                          |    2 
 sc/source/filter/oox/pagesettings.cxx                              |    2 
 sc/source/filter/oox/stylesbuffer.cxx                              |    6 
 sc/source/filter/orcus/interface.cxx                               |    2 
 sc/source/ui/drawfunc/drawsh.cxx                                   |    2 
 sc/source/ui/drawfunc/drawsh2.cxx                                  |    2 
 sc/source/ui/unoobj/cellsuno.cxx                                   |   10 
 sc/source/ui/unoobj/condformatuno.cxx                              |    4 
 sc/source/ui/unoobj/confuno.cxx                                    |    7 
 sc/source/ui/vba/vbaborders.cxx                                    |    2 
 sc/source/ui/vba/vbainterior.cxx                                   |   10 
 sc/source/ui/view/editsh.cxx                                       |    2 
 sc/source/ui/view/formatsh.cxx                                     |    2 
 sc/source/ui/view/tabview3.cxx                                     |    2 
 sd/source/filter/eppt/pptx-stylesheet.cxx                          |    6 
 sd/source/filter/html/htmlex.cxx                                   |   20 -
 sd/source/filter/ppt/ppt97animations.cxx                           |    2 
 sd/source/ui/animations/CustomAnimationDialog.cxx                  |   13 
 sd/source/ui/dlg/copydlg.cxx                                       |    4 
 sd/source/ui/presenter/PresenterTextView.cxx                       |    8 
 sd/source/ui/slideshow/slideshowimpl.cxx                           |    4 
 sd/source/ui/slidesorter/shell/SlideSorterService.cxx              |    8 
 sd/source/ui/view/drtxtob1.cxx                                     |    2 
 sd/source/ui/view/drviews2.cxx                                     |    2 
 sd/source/ui/view/drviews7.cxx                                     |    2 
 sfx2/source/control/recentdocsview.cxx                             |    8 
 sfx2/source/control/templatedefaultview.cxx                        |    8 
 sfx2/source/sidebar/Theme.cxx                                      |    6 
 starmath/inc/token.hxx                                             |    2 
 starmath/source/mathmlexport.cxx                                   |    2 
 starmath/source/node.cxx                                           |    2 
 svtools/source/config/colorcfg.cxx                                 |    4 
 svtools/source/config/optionsdrawinglayer.cxx                      |    8 
 svtools/source/uno/unocontroltablemodel.cxx                        |    2 
 svx/source/dialog/hexcolorcontrol.cxx                              |    2 
 svx/source/fmcomp/fmgridif.cxx                                     |    8 
 svx/source/svdraw/svdattr.cxx                                      |    2 
 svx/source/tbxctrls/PaletteManager.cxx                             |    4 
 svx/source/unodraw/XPropertyTable.cxx                              |    6 
 svx/source/xoutdev/xattr.cxx                                       |   34 +-
 svx/source/xoutdev/xtabcolr.cxx                                    |    2 
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx                         |   20 -
 sw/qa/extras/ooxmlexport/ooxmlexport2.cxx                          |    2 
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx                          |    4 
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx                          |    2 
 sw/qa/extras/rtfexport/rtfexport.cxx                               |    4 
 sw/qa/extras/rtfexport/rtfexport2.cxx                              |    6 
 sw/qa/extras/rtfexport/rtfexport4.cxx                              |    2 
 sw/qa/extras/ww8export/ww8export.cxx                               |    6 
 sw/qa/extras/ww8export/ww8export3.cxx                              |   16 -
 sw/source/core/access/AccessibilityCheck.cxx                       |    8 
 sw/source/core/access/acccell.cxx                                  |    2 
 sw/source/core/access/accpara.cxx                                  |   10 
 sw/source/core/access/acctable.cxx                                 |    2 
 sw/source/core/inc/wrong.hxx                                       |    8 
 sw/source/core/layout/atrfrm.cxx                                   |    4 
 sw/source/core/unocore/unotbl.cxx                                  |    2 
 sw/source/filter/html/htmlforw.cxx                                 |    4 
 sw/source/filter/writer/wrtswtbl.cxx                               |    6 
 sw/source/filter/ww8/docxattributeoutput.cxx                       |    2 
 sw/source/filter/ww8/wrtww8gr.cxx                                  |    4 
 sw/source/filter/ww8/ww8atr.cxx                                    |    2 
 sw/source/filter/ww8/ww8par6.cxx                                   |   18 -
 sw/source/filter/xml/xmlimpit.cxx                                  |    5 
 sw/source/uibase/app/docsh2.cxx                                    |    2 
 sw/source/uibase/config/modcfg.cxx                                 |    8 
 sw/source/uibase/shells/basesh.cxx                                 |    2 
 sw/source/uibase/shells/drawdlg.cxx                                |    2 
 sw/source/uibase/shells/drwtxtex.cxx                               |    2 
 sw/source/uibase/shells/textsh1.cxx                                |    4 
 sw/source/uibase/utlui/shdwcrsr.cxx                                |    2 
 toolkit/source/awt/stylesettings.cxx                               |    2 
 toolkit/source/awt/vclxgraphics.cxx                                |   10 
 toolkit/source/awt/vclxwindow.cxx                                  |   39 +-
 toolkit/source/awt/vclxwindows.cxx                                 |   31 +-
 tools/qa/cppunit/test_color.cxx                                    |    4 
 vbahelper/source/vbahelper/vbacolorformat.cxx                      |    2 
 vcl/headless/CustomWidgetDraw.cxx                                  |  139 +++++-----
 vcl/headless/svpgdi.cxx                                            |    2 
 vcl/inc/bitmap/ScanlineTools.hxx                                   |    2 
 vcl/qa/cppunit/BitmapExTest.cxx                                    |   12 
 vcl/qa/cppunit/BitmapProcessorTest.cxx                             |    6 
 vcl/qa/cppunit/BitmapTest.cxx                                      |   14 -
 vcl/qa/cppunit/ScanlineToolsTest.cxx                               |   15 -
 vcl/qa/cppunit/bitmapcolor.cxx                                     |    2 
 vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx                   |   27 +
 vcl/qa/cppunit/png/PngFilterTest.cxx                               |  120 +++++---
 vcl/qt5/Qt5AccessibleWidget.cxx                                    |    4 
 vcl/qt5/Qt5Graphics_GDI.cxx                                        |    5 
 vcl/skia/gdiimpl.cxx                                               |    2 
 vcl/skia/salbmp.cxx                                                |    2 
 vcl/source/app/settings.cxx                                        |    2 
 vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx                  |    9 
 vcl/source/bitmap/BitmapDisabledImageFilter.cxx                    |    2 
 vcl/source/bitmap/BitmapReadAccess.cxx                             |   16 -
 vcl/source/gdi/gdimtf.cxx                                          |    4 
 vcl/source/graphic/GraphicObject2.cxx                              |    2 
 vcl/source/helper/canvastools.cxx                                  |    2 
 vcl/source/pdf/PDFiumLibrary.cxx                                   |    8 
 vcl/source/window/menubarwindow.cxx                                |    2 
 vcl/unx/generic/app/saldisp.cxx                                    |    6 
 writerfilter/source/dmapper/BorderHandler.cxx                      |    2 
 writerfilter/source/dmapper/CellColorHandler.cxx                   |    6 
 writerfilter/source/dmapper/DomainMapper.cxx                       |    2 
 writerfilter/source/dmapper/TDefTableHandler.cxx                   |    2 
 writerfilter/source/rtftok/rtfsdrimport.cxx                        |   19 -
 xmloff/source/chart/ColorPropertySet.cxx                           |    2 
 xmloff/source/style/TransGradientStyle.cxx                         |    4 
 xmloff/source/style/xmlnumi.cxx                                    |    6 
 170 files changed, 767 insertions(+), 595 deletions(-)

New commits:
commit 63a68064bb33f180b8a231f7524d99405d910226
Author:     Noel <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jan 15 14:49:12 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jan 16 10:07:07 2021 +0100

    make the Color constructors explicitly specify transparency
    
    to reduce the churn, we leave the existing constructor in place,
    and add a clang plugin to detect when the value passed to the
    existing constructor may contain transparency/alpha data.
    
    i.e. we leave expressions like Color(0xffffff) alone, but
    warn about any non-constant expression, and any expression
    like Color(0xff000000)
    
    Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/UnoControls/source/controls/progressbar.cxx b/UnoControls/source/controls/progressbar.cxx
index f88aca35034b..a2a8222c0529 100644
--- a/UnoControls/source/controls/progressbar.cxx
+++ b/UnoControls/source/controls/progressbar.cxx
@@ -140,7 +140,7 @@ void SAL_CALL ProgressBar::setForegroundColor( sal_Int32 nColor )
     MutexGuard  aGuard (m_aMutex);
 
     // Safe color for later use.
-    m_nForegroundColor = Color(nColor);
+    m_nForegroundColor = Color(ColorTransparency, nColor);
 
     // Repaint control
     impl_paint ( 0, 0, impl_getGraphicsPeer() );
@@ -154,7 +154,7 @@ void SAL_CALL ProgressBar::setBackgroundColor ( sal_Int32 nColor )
     MutexGuard  aGuard (m_aMutex);
 
     // Safe color for later use.
-    m_nBackgroundColor = Color(nColor);
+    m_nBackgroundColor = Color(ColorTransparency, nColor);
 
     // Repaint control
     impl_paint ( 0, 0, impl_getGraphicsPeer() );
diff --git a/UnoControls/source/inc/progressbar.hxx b/UnoControls/source/inc/progressbar.hxx
index 1f735286377b..f327b453b19b 100644
--- a/UnoControls/source/inc/progressbar.hxx
+++ b/UnoControls/source/inc/progressbar.hxx
@@ -30,14 +30,14 @@ namespace unocontrols {
 #define PROGRESSBAR_FREESPACE               4
 #define PROGRESSBAR_DEFAULT_HORIZONTAL      true
 #define PROGRESSBAR_DEFAULT_BLOCKDIMENSION  Size(1,1)
-#define PROGRESSBAR_DEFAULT_BACKGROUNDCOLOR sal_Int32(Color( 0x00, 0xC0, 0xC0, 0xC0 )) // lightgray
-#define PROGRESSBAR_DEFAULT_FOREGROUNDCOLOR sal_Int32(Color( 0x00, 0x00, 0x00, 0x80 )) // blue
+#define PROGRESSBAR_DEFAULT_BACKGROUNDCOLOR sal_Int32(Color( 0xC0, 0xC0, 0xC0 )) // lightgray
+#define PROGRESSBAR_DEFAULT_FOREGROUNDCOLOR sal_Int32(Color( 0x00, 0x00, 0x80 )) // blue
 #define PROGRESSBAR_DEFAULT_MINRANGE        INT_MIN
 #define PROGRESSBAR_DEFAULT_MAXRANGE        INT_MAX
 #define PROGRESSBAR_DEFAULT_BLOCKVALUE      1
 #define PROGRESSBAR_DEFAULT_VALUE           PROGRESSBAR_DEFAULT_MINRANGE
-#define PROGRESSBAR_LINECOLOR_BRIGHT        sal_Int32(Color( 0x00, 0xFF, 0xFF, 0xFF )) // white
-#define PROGRESSBAR_LINECOLOR_SHADOW        sal_Int32(Color( 0x00, 0x00, 0x00, 0x00 )) // black
+#define PROGRESSBAR_LINECOLOR_BRIGHT        sal_Int32(Color( 0xFF, 0xFF, 0xFF )) // white
+#define PROGRESSBAR_LINECOLOR_SHADOW        sal_Int32(Color( 0x00, 0x00, 0x00 )) // black
 
 class ProgressBar final : public css::awt::XControlModel
                     , public css::awt::XProgressBar
diff --git a/UnoControls/source/inc/progressmonitor.hxx b/UnoControls/source/inc/progressmonitor.hxx
index 7be8056396f3..3fe17c578751 100644
--- a/UnoControls/source/inc/progressmonitor.hxx
+++ b/UnoControls/source/inc/progressmonitor.hxx
@@ -39,8 +39,8 @@ class ProgressBar;
 #define PROGRESSMONITOR_FREEBORDER                      10                                                      // border around and between the controls
 #define PROGRESSMONITOR_DEFAULT_TOPIC                   ""
 #define PROGRESSMONITOR_DEFAULT_TEXT                    ""
-#define PROGRESSMONITOR_LINECOLOR_BRIGHT                sal_Int32(Color( 0x00, 0xFF, 0xFF, 0xFF ))             // white
-#define PROGRESSMONITOR_LINECOLOR_SHADOW                sal_Int32(Color( 0x00, 0x00, 0x00, 0x00 ))             // black
+#define PROGRESSMONITOR_LINECOLOR_BRIGHT                sal_Int32(Color( 0xFF, 0xFF, 0xFF ))             // white
+#define PROGRESSMONITOR_LINECOLOR_SHADOW                sal_Int32(Color( 0x00, 0x00, 0x00 ))             // black
 #define PROGRESSMONITOR_DEFAULT_WIDTH                   350
 #define PROGRESSMONITOR_DEFAULT_HEIGHT                  100
 
diff --git a/UnoControls/source/inc/statusindicator.hxx b/UnoControls/source/inc/statusindicator.hxx
index f47a52cbd814..14ac4e03b8d9 100644
--- a/UnoControls/source/inc/statusindicator.hxx
+++ b/UnoControls/source/inc/statusindicator.hxx
@@ -36,9 +36,9 @@ namespace unocontrols {
 class ProgressBar;
 
 #define STATUSINDICATOR_FREEBORDER              5                                                       // border around and between the controls
-#define STATUSINDICATOR_BACKGROUNDCOLOR         sal_Int32(Color( 0x00, 0xC0, 0xC0, 0xC0 ))              // lightgray
-#define STATUSINDICATOR_LINECOLOR_BRIGHT        sal_Int32(Color( 0x00, 0xFF, 0xFF, 0xFF ))              // white
-#define STATUSINDICATOR_LINECOLOR_SHADOW        sal_Int32(Color( 0x00, 0x00, 0x00, 0x00 ))              // black
+#define STATUSINDICATOR_BACKGROUNDCOLOR         sal_Int32(Color( 0xC0, 0xC0, 0xC0 ))              // lightgray
+#define STATUSINDICATOR_LINECOLOR_BRIGHT        sal_Int32(Color( 0xFF, 0xFF, 0xFF ))              // white
+#define STATUSINDICATOR_LINECOLOR_SHADOW        sal_Int32(Color( 0x00, 0x00, 0x00 ))              // black
 #define STATUSINDICATOR_DEFAULT_WIDTH           300
 #define STATUSINDICATOR_DEFAULT_HEIGHT          25
 
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 2f29fd09b225..a5df0dcc03e4 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -646,11 +646,11 @@ void DataBrowser::RenewTable()
     {
         auto spHeader = std::make_shared<impl::SeriesHeader>( m_pColumnsWin, m_pColorsWin );
         Reference< beans::XPropertySet > xSeriesProp( elemHeader.m_xDataSeries, uno::UNO_QUERY );
-        sal_Int32 nColor = 0;
+        Color nColor;
         // @todo: Set "DraftColor", i.e. interpolated colors for gradients, bitmaps, etc.
         if( xSeriesProp.is() &&
             ( xSeriesProp->getPropertyValue( "Color" ) >>= nColor ))
-            spHeader->SetColor( Color( nColor ));
+            spHeader->SetColor( nColor );
         spHeader->SetChartType( elemHeader.m_xChartType, elemHeader.m_bSwapXAndYAxis );
         spHeader->SetSeriesName(
             DataSeriesHelper::getDataSeriesLabel(
@@ -1278,10 +1278,10 @@ void DataBrowser::RenewSeriesHeaders()
     {
         auto spHeader = std::make_shared<impl::SeriesHeader>( m_pColumnsWin, m_pColorsWin );
         Reference< beans::XPropertySet > xSeriesProp(elemHeader.m_xDataSeries, uno::UNO_QUERY);
-        sal_Int32 nColor = 0;
+        Color nColor;
         if( xSeriesProp.is() &&
             ( xSeriesProp->getPropertyValue( "Color" ) >>= nColor ))
-            spHeader->SetColor( Color( nColor ));
+            spHeader->SetColor( nColor );
         spHeader->SetChartType( elemHeader.m_xChartType, elemHeader.m_bSwapXAndYAxis );
         spHeader->SetSeriesName(
             DataSeriesHelper::getDataSeriesLabel(
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 07ce43a171b0..16fd2d2c9f56 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -153,7 +153,7 @@ namespace
     Color lcl_getAmbientColor(
         const uno::Reference< beans::XPropertySet > & xSceneProperties )
     {
-        sal_Int32 nResult = 0x000000;
+        Color nResult;
         try
         {
             xSceneProperties->getPropertyValue("D3DSceneAmbientColor") >>= nResult;
@@ -162,7 +162,7 @@ namespace
         {
             DBG_UNHANDLED_EXCEPTION("chart2");
         }
-        return Color( nResult );
+        return nResult;
     }
 
     void lcl_setAmbientColor(
diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 7693c6ccfa37..2c27b6ae7dc1 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -216,7 +216,7 @@ DataPointItemConverter::DataPointItemConverter(
         m_bDataSeries( bDataSeries ),
         m_bOverwriteLabelsForAttributedDataPointsAlso(m_bDataSeries && bOverwriteLabelsForAttributedDataPointsAlso),
         m_bUseSpecialFillColor(bUseSpecialFillColor),
-        m_nSpecialFillColor(nSpecialFillColor),
+        m_nSpecialFillColor(ColorTransparency, nSpecialFillColor),
         m_nNumberFormat(nNumberFormat),
         m_nPercentNumberFormat(nPercentNumberFormat),
         m_aAvailableLabelPlacements(),
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index a5feac9eb7a6..55b4bed88ab6 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -1004,7 +1004,7 @@ void ChartController::executeDispatch_LineColor(sal_uInt32 nColor)
             }
 
             if( xPropSet.is() )
-                xPropSet->setPropertyValue( "LineColor", css::uno::makeAny( Color(nColor) ) );
+                xPropSet->setPropertyValue( "LineColor", css::uno::makeAny( Color(ColorTransparency, nColor) ) );
         }
     }
     catch( const uno::Exception& )
diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.cxx b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
index e1fdc3299e59..55a756c6edf3 100644
--- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
@@ -504,7 +504,7 @@ void ChartAreaPanel::updateData()
     {
         sal_uInt32 nFillColor = 0;
         xPropSet->getPropertyValue("FillColor") >>= nFillColor;
-        XFillColorItem aFillColorItem("", Color(nFillColor));
+        XFillColorItem aFillColorItem("", Color(ColorTransparency, nFillColor));
         updateFillColor(true, &aFillColorItem);
     }
 }
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index bb628a9419e3..d3c4dcd857e8 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -1125,13 +1125,13 @@ double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropN
         if(rPropName.endsWith("Color"))
         {
             //optimized interpolation for color values
-            Color aColor(static_cast<sal_uInt32>(fValue));
-            Color aOldColor(static_cast<sal_uInt32>(fOldValue));
+            Color aColor(ColorTransparency, static_cast<sal_uInt32>(fValue));
+            Color aOldColor(ColorTransparency, static_cast<sal_uInt32>(fOldValue));
             sal_uInt8 r = aOldColor.GetRed() + (aColor.GetRed() - aOldColor.GetRed()) * mnPercent;
             sal_uInt8 g = aOldColor.GetGreen() + (aColor.GetGreen() - aOldColor.GetGreen()) * mnPercent;
             sal_uInt8 b = aOldColor.GetBlue() + (aColor.GetBlue() - aOldColor.GetBlue()) * mnPercent;
-            sal_uInt8 t = 255 - (aOldColor.GetAlpha() + (aColor.GetAlpha() - aOldColor.GetAlpha()) * mnPercent);
-            Color aRet(t, r, g, b);
+            sal_uInt8 a = aOldColor.GetAlpha() + (aColor.GetAlpha() - aOldColor.GetAlpha()) * mnPercent;
+            Color aRet(ColorAlpha, a, r, g, b);
             return sal_uInt32(aRet);
         }
         return fOldValue + (fValue - fOldValue) * mnPercent;
diff --git a/compilerplugins/clang/colorcheck.cxx b/compilerplugins/clang/colorcheck.cxx
new file mode 100644
index 000000000000..83f9a9688381
--- /dev/null
+++ b/compilerplugins/clang/colorcheck.cxx
@@ -0,0 +1,95 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+#ifndef LO_CLANG_SHARED_PLUGINS
+
+#include <memory>
+#include <cassert>
+#include <string>
+#include <iostream>
+#include <fstream>
+#include <set>
+
+#include "check.hxx"
+#include "plugin.hxx"
+
+/**
+*/
+
+namespace
+{
+class ColorCheck : public loplugin::FilteringPlugin<ColorCheck>
+{
+public:
+    explicit ColorCheck(loplugin::InstantiationData const& data)
+        : FilteringPlugin(data)
+    {
+    }
+
+    virtual void run() override
+    {
+        if (preRun())
+            TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
+    }
+
+    bool VisitCXXConstructExpr(const CXXConstructExpr*);
+};
+
+bool ColorCheck::VisitCXXConstructExpr(const CXXConstructExpr* constructExpr)
+{
+    if (ignoreLocation(constructExpr))
+        return true;
+
+    if (constructExpr->getNumArgs() != 1)
+        return true;
+
+    auto tc = loplugin::TypeCheck(constructExpr->getType());
+    if (!tc.Class("Color").GlobalNamespace())
+        return true;
+
+    StringRef aFileName = getFilenameOfLocation(
+        compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(constructExpr)));
+    if (loplugin::isSamePathname(aFileName, SRCDIR "/include/tools/color.hxx"))
+        return true;
+
+    const CXXConstructorDecl* constructorDecl = constructExpr->getConstructor();
+    constructorDecl = constructorDecl->getCanonicalDecl();
+
+    if (!loplugin::TypeCheck(constructorDecl->getParamDecl(0)->getType())
+             .Typedef("sal_uInt32")
+             .GlobalNamespace())
+        return true;
+
+    auto arg0 = constructExpr->getArg(0);
+    if (arg0->isCXX11ConstantExpr(compiler.getASTContext()))
+    {
+        if (!arg0->isValueDependent())
+        {
+            llvm::Optional<llvm::APSInt> xVal
+                = compat::getIntegerConstantExpr(arg0, compiler.getASTContext());
+            if (xVal && *xVal > 0xffffff)
+                report(DiagnosticsEngine::Warning,
+                       "Rather use the ColorTransparency or ColorAlpha version of this constructor",
+                       arg0->getExprLoc());
+            return true;
+        }
+    }
+    report(DiagnosticsEngine::Warning,
+           "Rather use the ColorTransparency or ColorAlpha version of this constructor",
+           arg0->getExprLoc());
+
+    return true;
+}
+
+loplugin::Plugin::Registration<ColorCheck> colorcheck("colorcheck");
+
+} // namespace
+
+#endif // LO_CLANG_SHARED_PLUGINS
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx
index 660241519110..525761c3c86c 100644
--- a/cui/source/options/cfgchart.cxx
+++ b/cui/source/options/cfgchart.cxx
@@ -217,7 +217,7 @@ bool SvxChartOptions::RetrieveOptions()
         // set color values
         for( sal_Int32 i=0; i < nCount; i++ )
         {
-            aCol = Color(aColorSeq[ i ]);
+            aCol = Color(ColorTransparency, aColorSeq[ i ]);
 
             aName = aPrefix + OUString::number(i + 1) + aPostfix;
 
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 1956d0c8f86a..e6eadad2075b 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -286,7 +286,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, SpinValueHdl_Impl, weld::SpinButton&, void)
 IMPL_LINK_NOARG(SvxColorTabPage, MetricSpinValueHdl_Impl, weld::MetricSpinButton&, void)
 {
     // read current MtrFields, if cmyk, then k-value as transparency
-    aCurrentColor = Color(static_cast<sal_uInt8>(PercentToColor_Impl(m_xKcustom->get_value(FieldUnit::NONE))),
+    aCurrentColor = Color(ColorTransparency, static_cast<sal_uInt8>(PercentToColor_Impl(m_xKcustom->get_value(FieldUnit::NONE))),
                           static_cast<sal_uInt8>(PercentToColor_Impl(m_xCcustom->get_value(FieldUnit::NONE))),
                           static_cast<sal_uInt8>(PercentToColor_Impl(m_xYcustom->get_value(FieldUnit::NONE))),
                           static_cast<sal_uInt8>(PercentToColor_Impl(m_xMcustom->get_value(FieldUnit::NONE))));
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx
index 5b1be584b18f..174a2d4e4ea7 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -330,10 +330,9 @@ bool ORTFImportExport::Write()
     bool bUnderline     = ( css::awt::FontUnderline::NONE  != m_aFont.Underline );
     bool bStrikeout     = ( css::awt::FontStrikeout::NONE  != m_aFont.Strikeout );
 
-    sal_Int32 nColor = 0;
+    ::Color aColor;
     if(m_xObject.is())
-        m_xObject->getPropertyValue(PROPERTY_TEXTCOLOR) >>= nColor;
-    ::Color aColor(nColor);
+        m_xObject->getPropertyValue(PROPERTY_TEXTCOLOR) >>= aColor;
 
     OString aFonts(OUStringToOString(m_aFont.Name, RTL_TEXTENCODING_MS_1252));
     if (aFonts.isEmpty())
@@ -661,10 +660,9 @@ void OHTMLImportExport::WriteBody()
 
     // default Textcolour black
     m_pStream->WriteChar( '<' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_body ).WriteChar( ' ' ).WriteCharPtr( OOO_STRING_SVTOOLS_HTML_O_text ).WriteChar( '=' );
-    sal_Int32 nColor = 0;
+    ::Color aColor;
     if(m_xObject.is())
-        m_xObject->getPropertyValue(PROPERTY_TEXTCOLOR) >>= nColor;
-    ::Color aColor(nColor);
+        m_xObject->getPropertyValue(PROPERTY_TEXTCOLOR) >>= aColor;
     HTMLOutFuncs::Out_Color( (*m_pStream), aColor );
 
     m_pStream->WriteCharPtr( " " OOO_STRING_SVTOOLS_HTML_O_bgcolor "=" );
@@ -931,10 +929,9 @@ void OHTMLImportExport::FontOn()
             "=";
     m_pStream->WriteOString( aStrOut );
 
-    sal_Int32 nColor = 0;
+    ::Color aColor;
     if(m_xObject.is())
-        m_xObject->getPropertyValue(PROPERTY_TEXTCOLOR) >>= nColor;
-    ::Color aColor(nColor);
+        m_xObject->getPropertyValue(PROPERTY_TEXTCOLOR) >>= aColor;
 
     HTMLOutFuncs::Out_Color( (*m_pStream), aColor );
     m_pStream->WriteCharPtr( ">" );
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index a354b2960942..250765832cec 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -35,7 +35,7 @@
 #include <vcl/virdev.hxx>
 
 #define NOT_LOADED  (tools::Long(-1))
-#define NOT_LOADED_COLOR  (Color(0xffffffff))
+#define NOT_LOADED_COLOR  (Color(ColorTransparency, 0xffffffff))
 
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::task;
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index b96cca222e7f..21bf591aecc0 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -82,14 +82,14 @@ namespace
 
                         if(nAlpha)
                         {
-                            aContent.SetPixel(y, x, Color(
-                                255 - static_cast<sal_uInt8>(nAlpha),
+                            aContent.SetPixel(y, x, Color(ColorAlpha,
+                                static_cast<sal_uInt8>(nAlpha),
                                 static_cast<sal_uInt8>(nRed / nDivisor),
                                 static_cast<sal_uInt8>(nGreen / nDivisor),
                                 static_cast<sal_uInt8>(nBlue / nDivisor) ));
                         }
                         else
-                            aContent.SetPixel(y, x, Color(255, 0, 0, 0));
+                            aContent.SetPixel(y, x, Color(ColorAlpha, 0, 0, 0, 0));
                     }
                 }
             }
@@ -105,10 +105,10 @@ namespace
 
                         if(rPixel.getAlpha())
                         {
-                            aContent.SetPixel(y, x, Color(255 - rPixel.getAlpha(), rPixel.getRed(), rPixel.getGreen(), rPixel.getBlue()));
+                            aContent.SetPixel(y, x, Color(ColorAlpha, rPixel.getAlpha(), rPixel.getRed(), rPixel.getGreen(), rPixel.getBlue()));
                         }
                         else
-                            aContent.SetPixel(y, x, Color(255, 0, 0, 0));
+                            aContent.SetPixel(y, x, Color(ColorAlpha, 0, 0, 0, 0));
                     }
                 }
             }
diff --git a/drawinglayer/source/tools/emfpbrush.cxx b/drawinglayer/source/tools/emfpbrush.cxx
index ca0c27b23ecf..24c3f281812b 100644
--- a/drawinglayer/source/tools/emfpbrush.cxx
+++ b/drawinglayer/source/tools/emfpbrush.cxx
@@ -77,7 +77,7 @@ namespace emfplushelper
                 sal_uInt32 color;
                 s.ReadUInt32(color);
 
-                solidColor = ::Color(0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
+                solidColor = ::Color(ColorAlpha, (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
                 SAL_INFO("drawinglayer", "EMF+\t\t\t\tSolid color: 0x" << std::hex << color << std::dec);
                 break;
             }
@@ -91,8 +91,8 @@ namespace emfplushelper
                 s.ReadUInt32(backgroundColor);
 
                 hatchStyle = static_cast<EmfPlusHatchStyle>(style);
-                solidColor = ::Color(0xff - (foregroundColor >> 24), (foregroundColor >> 16) & 0xff, (foregroundColor >> 8) & 0xff, foregroundColor & 0xff);
-                secondColor = ::Color(0xff - (backgroundColor >> 24), (backgroundColor >> 16) & 0xff, (backgroundColor >> 8) & 0xff, backgroundColor & 0xff);
+                solidColor = ::Color(ColorAlpha, (foregroundColor >> 24), (foregroundColor >> 16) & 0xff, (foregroundColor >> 8) & 0xff, foregroundColor & 0xff);
+                secondColor = ::Color(ColorAlpha, (backgroundColor >> 24), (backgroundColor >> 16) & 0xff, (backgroundColor >> 8) & 0xff, backgroundColor & 0xff);
                 SAL_INFO("drawinglayer", "EMF+\t\t\t\tHatch style: 0x" << std::hex << style);
                 SAL_INFO("drawinglayer", "EMF+\t\t\t\tForeground color: 0x" << solidColor.AsRGBHexString());
                 SAL_INFO("drawinglayer", "EMF+\t\t\t\tBackground color: 0x" << secondColor.AsRGBHexString());
@@ -109,7 +109,7 @@ namespace emfplushelper
                 SAL_INFO("drawinglayer", "EMF+\t\t\t\tAdditional flags: 0x" << std::hex << additionalFlags << std::dec);
                 sal_uInt32 color;
                 s.ReadUInt32(color);
-                solidColor = ::Color(0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
+                solidColor = ::Color(ColorAlpha, (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
                 SAL_INFO("drawinglayer", "EMF+\t\t\t\tCenter color: 0x" << std::hex << color << std::dec);
                 s.ReadFloat(firstPointX).ReadFloat(firstPointY);
                 SAL_INFO("drawinglayer", "EMF+\t\t\t\tCenter point: " << firstPointX << "," << firstPointY);
@@ -126,7 +126,7 @@ namespace emfplushelper
                 for (int i = 0; i < surroundColorsNumber; i++)
                 {
                     s.ReadUInt32(color);
-                    surroundColors[i] = ::Color(0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
+                    surroundColors[i] = ::Color(ColorAlpha, (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
                     if (i == 0)
                         secondColor = surroundColors[0];
                     SAL_INFO("drawinglayer", "EMF+\t\t\t\tSurround color[" << i << "]: 0x" << std::hex << color << std::dec);
@@ -236,7 +236,7 @@ namespace emfplushelper
                     for (int i = 0; i < colorblendPoints; i++)
                     {
                         s.ReadUInt32(color);
-                        colorblendColors[i] = ::Color(0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
+                        colorblendColors[i] = ::Color(ColorAlpha, (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
                         SAL_INFO("drawinglayer", "EMF+\t\t\t\tColor[" << i << "]: 0x" << std::hex << color << std::dec);
                     }
                 }
@@ -252,10 +252,10 @@ namespace emfplushelper
                                          << ", size " << aWidth << "x" << aHeight);
                 sal_uInt32 color;
                 s.ReadUInt32(color);
-                solidColor = ::Color(0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
+                solidColor = ::Color(ColorAlpha, (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
                 SAL_INFO("drawinglayer", "EMF+\t\t\t\tfirst color: 0x" << std::hex << color << std::dec);
                 s.ReadUInt32(color);
-                secondColor = ::Color(0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
+                secondColor = ::Color(ColorAlpha, (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
                 SAL_INFO("drawinglayer", "EMF+\t\t\t\tsecond color: 0x" << std::hex << color << std::dec);
 
                 // repeated colors, unknown meaning, see http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/ObjectBrush.html
@@ -318,7 +318,7 @@ namespace emfplushelper
                     for (int i = 0; i < colorblendPoints; i++)
                     {
                         s.ReadUInt32(color);
-                        colorblendColors[i] = ::Color(0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
+                        colorblendColors[i] = ::Color(ColorAlpha, (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
                         SAL_INFO("drawinglayer", "EMF+\t\t\t\tColor[" << i << "]: 0x" << std::hex << color << std::dec);
                     }
                 }
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index fb34dac496e2..d55babc0e960 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -454,7 +454,7 @@ namespace emfplushelper
         Color color;
         if (flags & 0x8000) // we use a color
         {
-            color = Color(0xff - (brushIndexOrColor >> 24), (brushIndexOrColor >> 16) & 0xff,
+            color = Color(ColorAlpha, (brushIndexOrColor >> 24), (brushIndexOrColor >> 16) & 0xff,
                           (brushIndexOrColor >> 8) & 0xff, brushIndexOrColor & 0xff);
         }
         else // we use a pen
@@ -724,7 +724,7 @@ namespace emfplushelper
 
             // EMF Alpha (1 byte): An 8-bit unsigned integer that specifies the transparency of the background,
             // ranging from 0 for completely transparent to 0xFF for completely opaque.
-            const Color color(0xff - (brushIndexOrColor >> 24), (brushIndexOrColor >> 16) & 0xff, (brushIndexOrColor >> 8) & 0xff, brushIndexOrColor & 0xff);
+            const Color color(ColorAlpha, (brushIndexOrColor >> 24), (brushIndexOrColor >> 16) & 0xff, (brushIndexOrColor >> 8) & 0xff, brushIndexOrColor & 0xff);
             EMFPPlusFillPolygonSolidColor(polygon, color);
 
             mrPropertyHolders.Current().setFillColor(color.getBColor());
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 6900e8cf8e1d..ac4bbe1ada4d 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -1471,7 +1471,7 @@ namespace accessibility
             if (rRes.Name == "CharColor")
             {
                 uno::Any &anyChar = rRes.Value;
-                Color crChar = static_cast<sal_uInt32>( reinterpret_cast<sal_uIntPtr>(anyChar.pReserved));
+                Color crChar(ColorTransparency, static_cast<sal_uInt32>( reinterpret_cast<sal_uIntPtr>(anyChar.pReserved)));
                 if (COL_AUTO == crChar )
                 {
                     uno::Reference< css::accessibility::XAccessibleComponent > xComponent(mxParent,uno::UNO_QUERY);
@@ -1485,7 +1485,7 @@ namespace accessibility
                         }
                         else
                         {
-                            Color cr(xComponent->getBackground());
+                            Color cr(ColorTransparency, xComponent->getBackground());
                             crChar = cr.IsDark() ? COL_WHITE : COL_BLACK;
                             anyChar <<= crChar;
                         }
@@ -1502,7 +1502,7 @@ namespace accessibility
             if (rRes.Name == "CharUnderlineColor")
             {
                 uno::Any &anyCharUnderLine = rRes.Value;
-                Color crCharUnderLine = static_cast<sal_uInt32>( reinterpret_cast<sal_uIntPtr>( anyCharUnderLine.pReserved));
+                Color crCharUnderLine(ColorTransparency, static_cast<sal_uInt32>( reinterpret_cast<sal_uIntPtr>( anyCharUnderLine.pReserved)));
                 if (COL_AUTO == crCharUnderLine )
                 {
                     uno::Reference< css::accessibility::XAccessibleComponent > xComponent(mxParent,uno::UNO_QUERY);
@@ -1516,7 +1516,7 @@ namespace accessibility
                         }
                         else
                         {
-                            Color cr(xComponent->getBackground());
+                            Color cr(ColorTransparency, xComponent->getBackground());
                             crCharUnderLine = cr.IsDark() ? COL_WHITE : COL_BLACK;
                             anyCharUnderLine <<= crCharUnderLine;
                         }
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 589bde044152..184bf21cd994 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1084,7 +1084,7 @@ bool SvxShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             sal_Int32 nTransparence = 0;
             if ((rVal >>= nTransparence) && !o3tl::checked_multiply<sal_Int32>(nTransparence, 255, nTransparence))
             {
-                Color aColor(aShadow.Color);
+                Color aColor(ColorTransparency, aShadow.Color);
                 aColor.SetAlpha(255 - rtl::math::round(float(nTransparence) / 100));
                 aShadow.Color = sal_Int32(aColor);
             }
@@ -1106,7 +1106,7 @@ bool SvxShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
         }
 
         nWidth = bConvert ? convertMm100ToTwip(aShadow.ShadowWidth) : aShadow.ShadowWidth;
-        Color aSet(aShadow.Color);
+        Color aSet(ColorTransparency, aShadow.Color);
         aShadowColor = aSet;
     }
 
@@ -1439,7 +1439,7 @@ namespace
 bool
 lcl_lineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLine, bool bConvert, bool bGuessWidth)
 {
-    rSvxLine.SetColor( Color(rLine.Color));
+    rSvxLine.SetColor( Color(ColorTransparency, rLine.Color));
     if ( bGuessWidth )
     {
         rSvxLine.GuessLinesWidths( rSvxLine.GetBorderLineStyle(),
@@ -2735,7 +2735,7 @@ bool SvxLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemId )
 
         switch ( nMemId )
         {
-            case MID_FG_COLOR:      pLine->SetColor( Color(nVal) ); break;
+            case MID_FG_COLOR:      pLine->SetColor( Color(ColorTransparency, nVal) ); break;
             case MID_LINE_STYLE:
                 pLine->SetBorderLineStyle(static_cast<SvxBorderLineStyle>(nVal));
             break;
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index e83d08b35504..e63b9c786e1d 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -990,7 +990,7 @@ bool SvxTextLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
     break;
     case MID_TL_COLOR:
     {
-        sal_Int32 nCol = 0;
+        Color nCol;
         if( !( rVal >>= nCol ) )
             bRet = false;
         else
@@ -998,7 +998,7 @@ bool SvxTextLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             // Keep transparence, because it contains the information
             // whether the font color or the stored color should be used
             sal_uInt8 nAlpha = mColor.GetAlpha();
-            mColor = Color( nCol );
+            mColor = nCol;
             mColor.SetAlpha( nAlpha );
         }
     }
@@ -1354,7 +1354,7 @@ bool SvxBackgroundColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) c
 bool SvxBackgroundColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
 {
     nMemberId &= ~CONVERT_TWIPS;
-    sal_Int32 nColor = 0;
+    Color nColor;
     Color aColor = SvxColorItem::GetValue();
 
     switch( nMemberId )
@@ -1369,7 +1369,7 @@ bool SvxBackgroundColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId
         {
             if(!(rVal >>= nColor))
                 return false;
-            SvxColorItem::SetValue( Color(nColor) );
+            SvxColorItem::SetValue( nColor );
             break;
         }
     }
diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx
index 761fa305e3f4..4e81037a36ae 100644
--- a/editeng/source/uno/unonrule.cxx
+++ b/editeng/source/uno/unonrule.cxx
@@ -427,10 +427,10 @@ void SvxUnoNumberingRules::setNumberingRuleByIndex(const Sequence<beans::Propert
         }
         else if ( rPropName == UNO_NAME_NRULE_BULLET_COLOR )
         {
-            sal_Int32 nColor = 0;
-            if( aVal >>= nColor )
+            Color aColor;
+            if( aVal >>= aColor )
             {
-                aFmt.SetBulletColor( static_cast<Color>(nColor) );
+                aFmt.SetBulletColor( aColor );
                 continue;
             }
         }
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index e1e80ec8bb04..b05beeb2a9dc 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -875,7 +875,7 @@ namespace emfio
         mnTextAlign(TA_LEFT | TA_TOP | TA_NOUPDATECP),
         maLatestTextColor(),
         maTextColor(),
-        maLatestBkColor(0x12345678),
+        maLatestBkColor(ColorTransparency, 0x12345678),
         maBkColor(COL_WHITE),
         mnLatestTextLayoutMode(ComplexTextLayoutFlags::Default),
         mnTextLayoutMode(ComplexTextLayoutFlags::Default),
diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx
index 995f0b94f25f..af276592fc41 100644
--- a/extensions/source/propctrlr/fontdialog.cxx
+++ b/extensions/source/propctrlr/fontdialog.cxx
@@ -233,9 +233,9 @@ namespace pcr
             SvxWordLineModeItem aWordLineModeItem(bWordLineMode, CFID_WORDLINEMODE);
 
             SvxUnderlineItem    aUnderlineItem(eUnderline,CFID_UNDERLINE);
-            aUnderlineItem.SetColor(Color(nTextLineColor));
+            aUnderlineItem.SetColor(Color(ColorTransparency, nTextLineColor));
 
-            SvxColorItem aSvxColorItem(Color(nColor32),CFID_CHARCOLOR);
+            SvxColorItem aSvxColorItem(Color(ColorTransparency, nColor32),CFID_CHARCOLOR);
             SvxLanguageItem aLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), CFID_LANGUAGE);
 
             // the 2 CJK props
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index c5b03aa270e5..c20f6287fe8d 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -478,7 +478,7 @@ namespace pcr
         css::util::Color nColor = sal_uInt32(COL_TRANSPARENT);
         if (_rValue.hasValue())
             _rValue >>= nColor;
-        getTypedControlWindow()->SelectEntry(nColor);
+        getTypedControlWindow()->SelectEntry(::Color(ColorTransparency, nColor));
     }
 
     Any SAL_CALL OColorControl::getValue()
diff --git a/filter/qa/cppunit/msfilter-test.cxx b/filter/qa/cppunit/msfilter-test.cxx
index ce7b4b7c4cbd..439aad88b674 100644
--- a/filter/qa/cppunit/msfilter-test.cxx
+++ b/filter/qa/cppunit/msfilter-test.cxx
@@ -56,7 +56,7 @@ void MSFilterTest::testTransColToIco()
     {
         const OString sMessage = "Index of unmatched color: " + OString::number(i);
         CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), aExpected[i],
-                                     static_cast<sal_uInt16>(msfilter::util::TransColToIco( Color(aStdCol[i]) )));
+                                     static_cast<sal_uInt16>(msfilter::util::TransColToIco( Color(ColorTransparency, aStdCol[i]) )));
     }
 
     // tdf#92471
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx
index e5753510bbd9..b70407027b7d 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -738,7 +738,7 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* )
                                         if (!bIsValid)
                                             break;
                                         if ( nBitDepth == 1 )
-                                            aBitmap.SetPixel( y, x, Color(static_cast<sal_uInt8>(nDat >> nBitsLeft) & 1) );
+                                            aBitmap.SetPixel( y, x, Color(ColorTransparency, static_cast<sal_uInt8>(nDat >> nBitsLeft) & 1) );
                                         else
                                         {
                                             aBitmap.SetPixel( y, x, nDat ? COL_WHITE : COL_BLACK );  // nBitDepth == 8
diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx
index bbaee08117eb..023351c33b4e 100644
--- a/filter/source/graphicfilter/itga/itga.cxx
+++ b/filter/source/graphicfilter/itga/itga.cxx
@@ -638,7 +638,7 @@ bool TGAReader::ImplReadBody()
                                 return false;
                             if ( nDummy >= mpFileHeader->nColorMapLength )
                                 return false;
-                            mpBitmap->SetPixel( nY, nX, Color(nDummy) );
+                            mpBitmap->SetPixel( nY, nX, Color(ColorTransparency, nDummy) );
                         }
                         break;
                     default:
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 5df267f3f954..31d382796f43 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -376,12 +376,12 @@ sal_uInt32 EscherPropertyContainer::GetGradientColor(
         if ( nStartColor & 1 )
         {
             nIntensity = pGradient->StartIntensity;
-            aColor = Color(pGradient->StartColor);
+            aColor = Color(ColorTransparency, pGradient->StartColor);
         }
         else
         {
             nIntensity = pGradient->EndIntensity;
-            aColor = Color(pGradient->EndColor);
+            aColor = Color(ColorTransparency, pGradient->EndColor);
         }
     }
     sal_uInt32  nRed = ( aColor.GetRed() * nIntensity ) / 100;
@@ -1452,7 +1452,7 @@ Graphic lclDrawHatch( const drawing::Hatch& rHatch, const Color& rBackColor, boo
     pVDev->SetLineColor();
     pVDev->SetFillColor(bFillBackground ? rBackColor : COL_TRANSPARENT);
     pVDev->DrawRect(rRect);
-    pVDev->DrawHatch(tools::PolyPolygon(rRect), Hatch(static_cast<HatchStyle>(rHatch.Style), Color(rHatch.Color), rHatch.Distance,
+    pVDev->DrawHatch(tools::PolyPolygon(rRect), Hatch(static_cast<HatchStyle>(rHatch.Style), Color(ColorTransparency, rHatch.Color), rHatch.Distance,
             Degree10(rHatch.Angle)));
     aMtf.Stop();
     aMtf.WindStart();
@@ -1547,7 +1547,7 @@ bool EscherPropertyContainer::CreateGraphicProperties(const uno::Reference<beans
                 Color aBackColor;
                 if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "FillColor" ) )
                 {
-                    aBackColor = Color(ImplGetColor( *o3tl::doAccess<sal_uInt32>(aAny), false ));
+                    aBackColor = Color(ColorTransparency, ImplGetColor( *o3tl::doAccess<sal_uInt32>(aAny), false ));
                 }
                 bool bFillBackground = false;
                 if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "FillBackground", true ) )
diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx
index 10b210b7b1bf..0677420f0bea 100644
--- a/forms/source/component/Grid.cxx
+++ b/forms/source/component/Grid.cxx
@@ -953,7 +953,7 @@ void OGridControlModel::read(const Reference<XObjectInputStream>& _rxInStream)
     if (nAnyMask & TEXTCOLOR)
     {
         sal_Int32 nValue = _rxInStream->readLong();
-        setTextColor( ::Color(nValue) );
+        setTextColor( ::Color(ColorTransparency, nValue) );
     }
     // new since version 6
     if (nVersion > 5)
diff --git a/forms/source/component/navigationbar.cxx b/forms/source/component/navigationbar.cxx
index 3d602d2abfa0..368ab62d3fa9 100644
--- a/forms/source/component/navigationbar.cxx
+++ b/forms/source/component/navigationbar.cxx
@@ -280,12 +280,12 @@ namespace frm
                 m_aBackgroundColor.clear();
 
             if ( nNonVoids & PERSIST_TEXTCOLOR )
-                setTextColor( ::Color(_rxInStream->readLong()) );
+                setTextColor( ::Color(ColorTransparency, _rxInStream->readLong()) );
             else
                 clearTextColor();
 
             if ( nNonVoids & PERSIST_TEXTLINECOLOR )
-                setTextLineColor( ::Color(_rxInStream->readLong()) );
+                setTextLineColor( ::Color(ColorTransparency, _rxInStream->readLong()) );
             else
                 clearTextLineColor();
         }
diff --git a/include/oox/helper/helper.hxx b/include/oox/helper/helper.hxx
index da28c88b9e4b..63718ca0ebed 100644
--- a/include/oox/helper/helper.hxx
+++ b/include/oox/helper/helper.hxx
@@ -78,7 +78,7 @@ const sal_uInt8 WINDOWS_CHARSET_EASTERN     = 238;
 const sal_uInt8 WINDOWS_CHARSET_OEM         = 255;
 
 
-const ::Color API_RGB_TRANSPARENT         (0xffffffff); ///< Transparent color for API calls.
+const ::Color API_RGB_TRANSPARENT         (ColorTransparency, 0xffffffff); ///< Transparent color for API calls.
 const sal_uInt32 UNSIGNED_RGB_TRANSPARENT = static_cast<sal_uInt32>(-1); ///< Transparent color for unsigned int32 places.
 const ::Color API_RGB_BLACK               (0x000000);  ///< Black color for API calls.
 const ::Color API_RGB_GRAY                (0x808080);  ///< Gray color for API calls.
diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx
index 0d3d68ba301c..88cea1c33ab7 100644
--- a/include/sax/tools/converter.hxx
+++ b/include/sax/tools/converter.hxx
@@ -123,7 +123,15 @@ public:
     {
         sal_Int32 n(rColor);
         bool b = convertColor( n, rValue );
-        if (b) rColor = n;
+        if (b) rColor = Color(ColorTransparency, n);
+        return b;
+    }
+    static bool convertColor( ::Color& rColor,
+                              std::string_view rValue )
+    {
+        sal_Int32 n(rColor);
+        bool b = convertColor( n, rValue );
+        if (b) rColor = Color(ColorTransparency, n);
         return b;
     }
 
diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index 3b347ede0690..8b4a035a1857 100644
--- a/include/svx/ColorSets.hxx
+++ b/include/svx/ColorSets.hxx
@@ -30,7 +30,7 @@ public:
 
     void add(sal_uInt32 nIndex, sal_uInt32 aColorData)
     {
-        maColors[nIndex] = Color(aColorData);
+        maColors[nIndex] = Color(ColorTransparency, aColorData);
     }
 
     const OUString& getName() const
diff --git a/include/svx/colorwindow.hxx b/include/svx/colorwindow.hxx
index 05917b2dfcfc..136d7621c0e7 100644
--- a/include/svx/colorwindow.hxx
+++ b/include/svx/colorwindow.hxx
@@ -44,7 +44,7 @@ public:
 
 class Button;
 
-#define COL_NONE_COLOR    ::Color(0x80, 0xFF, 0xFF, 0xFF)
+#define COL_NONE_COLOR    ::Color(ColorTransparency, 0x80, 0xFF, 0xFF, 0xFF)
 
 class SvxColorToolBoxControl;
 
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index aca6b0ed79b7..3226184ca117 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -40,6 +40,10 @@ constexpr sal_uInt8 ColorChannelMerge(sal_uInt8 nDst, sal_uInt8 nSrc, sal_uInt8
 
 }
 
+/** used to deliberately select the right constructor */
+enum ColorTransparencyTag { ColorTransparency = 0 };
+enum ColorAlphaTag { ColorAlpha = 0 };
+
 // Color
 
 class SAL_WARN_UNUSED TOOLS_DLLPUBLIC Color
@@ -70,21 +74,37 @@ public:
         : mValue(0) // black
     {}
 
-    constexpr Color(sal_uInt32 nColor)
+    constexpr Color(const sal_uInt32 nColor)
         : mValue(nColor)
-    {}
+    {
+        assert(nColor <= 0xffffff && "don't pass transparency to this constructor, use the Color(ColorTransparencyTag,...) or Color(ColorAlphaTag,...) constructor to make it explicit");
+    }
 
-    constexpr Color(sal_uInt8 nTransparency, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
+    constexpr Color(enum ColorTransparencyTag, sal_uInt32 nColor)
+        : mValue(nColor)
+    {
+    }
+
+    constexpr Color(enum ColorAlphaTag, sal_uInt32 nColor)
+        : mValue((nColor & 0xffffff) | (255 - (nColor >> 24)))
+    {
+    }
+
+    constexpr Color(enum ColorTransparencyTag, sal_uInt8 nTransparency, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
         : mValue(sal_uInt32(nBlue) | (sal_uInt32(nGreen) << 8) | (sal_uInt32(nRed) << 16) | (sal_uInt32(nTransparency) << 24))
     {}
 
+    constexpr Color(enum ColorAlphaTag, sal_uInt8 nAlpha, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
+        : Color(ColorTransparency, 255 - nAlpha, nRed, nGreen, nBlue)
+    {}
+
     constexpr Color(sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
-        : Color(0, nRed, nGreen, nBlue)
+        : Color(ColorTransparency, 0, nRed, nGreen, nBlue)
     {}
 
     // constructor to create a tools-Color from ::basegfx::BColor
     explicit Color(const basegfx::BColor& rBColor)
-        : Color(0,
+        : Color(ColorTransparency, 0,
                 sal_uInt8(std::lround(rBColor.getRed() * 255.0)),
                 sal_uInt8(std::lround(rBColor.getGreen() * 255.0)),
                 sal_uInt8(std::lround(rBColor.getBlue() * 255.0)))
@@ -394,7 +414,7 @@ inline bool operator >>=( const css::uno::Any & rAny, Color & value )
   sal_Int32 nTmp = {}; // spurious -Werror=maybe-uninitialized
   if (!(rAny >>= nTmp))
       return false;
-  value = Color(nTmp);
+  value = Color(ColorTransparency, nTmp);
   return true;
 }
 
@@ -413,7 +433,7 @@ namespace com::sun::star::uno {
 
 // Test compile time conversion of Color to sal_uInt32
 
-static_assert (sal_uInt32(Color(0x00, 0x12, 0x34, 0x56)) == 0x00123456);
+static_assert (sal_uInt32(Color(ColorTransparency, 0x00, 0x12, 0x34, 0x56)) == 0x00123456);
 static_assert (sal_uInt32(Color(0x12, 0x34, 0x56)) == 0x00123456);
 
 // Color types
@@ -437,8 +457,8 @@ constexpr ::Color COL_LIGHTMAGENTA            ( 0xFF, 0x00, 0xFF );
 constexpr ::Color COL_LIGHTGRAYBLUE           ( 0xE0, 0xE0, 0xFF );
 constexpr ::Color COL_YELLOW                  ( 0xFF, 0xFF, 0x00 );
 constexpr ::Color COL_WHITE                   ( 0xFF, 0xFF, 0xFF );
-constexpr ::Color COL_TRANSPARENT             ( 0xFF, 0xFF, 0xFF, 0xFF );
-constexpr ::Color COL_AUTO                    ( 0xFF, 0xFF, 0xFF, 0xFF );
+constexpr ::Color COL_TRANSPARENT             ( ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF );
+constexpr ::Color COL_AUTO                    ( ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF );
 constexpr ::Color COL_AUTHOR1_DARK            ( 198,  146,   0 );
 constexpr ::Color COL_AUTHOR1_NORMAL          ( 255,  255, 158 );
 constexpr ::Color COL_AUTHOR1_LIGHT           ( 255,  255, 195 );
diff --git a/include/vcl/BitmapColor.hxx b/include/vcl/BitmapColor.hxx
index 634ae6902d27..b5364b4d146f 100644
--- a/include/vcl/BitmapColor.hxx
+++ b/include/vcl/BitmapColor.hxx
@@ -27,7 +27,9 @@ class VCL_DLLPUBLIC BitmapColor final : public Color
 {
 public:
     inline              BitmapColor();
-    constexpr           BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue, sal_uInt8 cAlpha = 0 );
+    constexpr           BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue );
+    constexpr           BitmapColor( ColorTransparencyTag, sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue, sal_uInt8 cTransparency );
+    constexpr           BitmapColor( ColorAlphaTag, sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue, sal_uInt8 cAlpha );
 
     inline              BitmapColor( const Color& rColor );
     explicit inline     BitmapColor( sal_uInt8 cIndex );
@@ -45,8 +47,18 @@ inline BitmapColor::BitmapColor( const Color& rColor )
 {
 }
 
-constexpr BitmapColor::BitmapColor(sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue, sal_uInt8 cAlpha)
-    : Color(cAlpha, cRed, cGreen, cBlue)
+constexpr BitmapColor::BitmapColor(sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue)
+    : Color(cRed, cGreen, cBlue)
+{
+}
+
+constexpr BitmapColor::BitmapColor(ColorTransparencyTag, sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue, sal_uInt8 cTransparency)
+    : Color(ColorTransparency, cTransparency, cRed, cGreen, cBlue)
+{
+}
+
+constexpr BitmapColor::BitmapColor(ColorAlphaTag, sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue, sal_uInt8 cAlpha)
+    : Color(ColorAlpha, cAlpha, cRed, cGreen, cBlue)
 {
 }
 
diff --git a/include/vcl/RawBitmap.hxx b/include/vcl/RawBitmap.hxx
index 79cef7c47e00..d3dcb642cf6c 100644
--- a/include/vcl/RawBitmap.hxx
+++ b/include/vcl/RawBitmap.hxx
@@ -55,7 +55,7 @@ public:
         if (mnBitCount == 24)
             return Color(mpData[p], mpData[p + 1], mpData[p + 2]);
         else
-            return Color(mpData[p + 3], mpData[p], mpData[p + 1], mpData[p + 2]);
+            return Color(ColorTransparency, mpData[p + 3], mpData[p], mpData[p + 1], mpData[p + 2]);
     }
     // so we don't accidentally leave any code in that uses palette color indexes
     void SetPixel(tools::Long nY, tools::Long nX, BitmapColor nColor) = delete;
diff --git a/include/vcl/salgtype.hxx b/include/vcl/salgtype.hxx
index 902170555526..1ab62fbdb6c7 100644
--- a/include/vcl/salgtype.hxx
+++ b/include/vcl/salgtype.hxx
@@ -34,7 +34,7 @@ enum class DeviceFormat {
 #endif
                         };
 
-constexpr ::Color SALCOLOR_NONE ( 0xFF, 0xFF, 0xFF, 0xFF );
+constexpr ::Color SALCOLOR_NONE ( ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF );
 
 struct SalTwoRect
 {
diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index d3b274e1fa3d..ecaa4c5121e4 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -727,7 +727,7 @@ struct ObjectFormatterData
 
 DetailFormatterBase::DetailFormatterBase( ObjectFormatterData& rData, const AutoFormatEntry* pAutoFormatEntry ) :
     mrData( rData ),
-    mnPhClr( 0xffffffff )
+    mnPhClr( ColorTransparency, 0xffffffff )
 {
     if( !pAutoFormatEntry )
         return;
@@ -749,7 +749,7 @@ DetailFormatterBase::DetailFormatterBase( ObjectFormatterData& rData, const Auto
 
 DetailFormatterBase::DetailFormatterBase( ObjectFormatterData& rData, const AutoTextEntry* pAutoTextEntry ) :
     mrData( rData ),
-    mnPhClr( 0xffffffff )
+    mnPhClr( ColorTransparency, 0xffffffff )
 {
     if( pAutoTextEntry && (pAutoTextEntry->mnColorToken != XML_TOKEN_INVALID) )
         mnPhClr = getSchemeColor( pAutoTextEntry->mnColorToken, XML_TOKEN_INVALID, 0 );
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index e87079945600..1cd5d2ebaed7 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -261,7 +261,7 @@ void Color::setSrgbClr( sal_Int32 nRgb )
 {
     OSL_ENSURE( (0 <= nRgb) && (nRgb <= 0xFFFFFF), "Color::setSrgbClr - invalid RGB value" );
     meMode = COLOR_RGB;
-    lclRgbToRgbComponents( mnC1, mnC2, mnC3, ::Color(nRgb) );
+    lclRgbToRgbComponents( mnC1, mnC2, mnC3, ::Color(ColorTransparency, nRgb) );
 }
 
 void Color::setScrgbClr( sal_Int32 nR, sal_Int32 nG, sal_Int32 nB )
@@ -495,10 +495,10 @@ void Color::clearTransparence()
 
         case COLOR_SCHEME:  setResolvedRgb( rGraphicHelper.getSchemeColor( mnC1 ) );        break;
         case COLOR_PALETTE: setResolvedRgb( rGraphicHelper.getPaletteColor( mnC1 ) );       break;
-        case COLOR_SYSTEM:  setResolvedRgb( rGraphicHelper.getSystemColor( mnC1, ::Color(mnC2) ) );  break;
+        case COLOR_SYSTEM:  setResolvedRgb( rGraphicHelper.getSystemColor( mnC1, ::Color(ColorTransparency, mnC2) ) );  break;
         case COLOR_PH:      setResolvedRgb( nPhClr );                                       break;
 
-        case COLOR_FINAL:   return ::Color(mnC1);
+        case COLOR_FINAL:   return ::Color(ColorTransparency, mnC1);
     }
 
     // if color is UNUSED or turns to UNUSED in setResolvedRgb, do not perform transformations
@@ -647,7 +647,7 @@ void Color::clearTransparence()
     }
     if( meMode == COLOR_FINAL )
         maTransforms.clear();
-    return ::Color(nRet);
+    return ::Color(ColorTransparency, nRet);
 }
 
 bool Color::hasTransparency() const
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 98ef5de040b7..f5aa1c2cd9f2 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -967,8 +967,8 @@ Reference< XShape > const & Shape::createAndInsert(
 
         const GraphicHelper& rGraphicHelper = rFilterBase.getGraphicHelper();
 
-        ::Color nLinePhClr(0xffffffff);
-        ::Color nFillPhClr(0xffffffff);
+        ::Color nLinePhClr(ColorTransparency, 0xffffffff);
+        ::Color nFillPhClr(ColorTransparency, 0xffffffff);
         // TODO: use ph color when applying effect properties
         //sal_Int32 nEffectPhClr = -1;
 
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 24fc7dc88aad..177660e42f85 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -481,7 +481,7 @@ static sal_Int32 lcl_generateRandomValue()
 static sal_Int32 lcl_getAlphaFromTransparenceGradient(const awt::Gradient& rGradient, bool bStart)
 {
     // Our alpha is a gray color value.
-    sal_uInt8 nRed = ::Color(bStart ? rGradient.StartColor : rGradient.EndColor).GetRed();
+    sal_uInt8 nRed = ::Color(ColorTransparency, bStart ? rGradient.StartColor : rGradient.EndColor).GetRed();
     // drawingML alpha is a percentage on a 0..100000 scale.
     return (255 - nRed) * oox::drawingml::MAX_PERCENT / 255;
 }
@@ -1839,7 +1839,7 @@ void ChartExport::exportSolidFill(const Reference< XPropertySet >& xPropSet)
         mpFS->endElementNS(XML_a, XML_gradFill);
     }
     else
-        WriteSolidFill(::Color(nFillColor & 0xffffff), nAlpha);
+        WriteSolidFill(::Color(ColorTransparency, nFillColor & 0xffffff), nAlpha);
 }
 
 void ChartExport::exportHatch( const Reference< XPropertySet >& xPropSet )
@@ -3880,7 +3880,7 @@ void ChartExport::exportDataPoints(
             else
             {
                 // property set only containing the color
-                xPropSet.set( new ColorPropertySet( xColorScheme->getColorByIndex( nElement )));
+                xPropSet.set( new ColorPropertySet( ColorTransparency, xColorScheme->getColorByIndex( nElement )));
             }
 
             if( xPropSet.is() )
@@ -4245,7 +4245,7 @@ void ChartExport::exportMarker(const Reference< XPropertySet >& xPropSet)
             pFS->singleElement(FSNS(XML_a, XML_noFill));
         }
         else
-            WriteSolidFill(::Color(aColor));
+            WriteSolidFill(::Color(ColorTransparency, aColor));
 
         pFS->endElement( FSNS( XML_c, XML_spPr ) );
     }
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 897fb0ff42a8..54003cd32fc7 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -139,7 +139,7 @@ namespace
 sal_Int32 GetAlphaFromTransparenceGradient(const awt::Gradient& rGradient, bool bStart)
 {
     // Our alpha is a gray color value.
-    sal_uInt8 nRed = ::Color(bStart ? rGradient.StartColor : rGradient.EndColor).GetRed();
+    sal_uInt8 nRed = ::Color(ColorTransparency, bStart ? rGradient.StartColor : rGradient.EndColor).GetRed();
     // drawingML alpha is a percentage on a 0..100000 scale.
     return (255 - nRed) * oox::drawingml::MAX_PERCENT / 255;
 }
@@ -481,7 +481,7 @@ void DrawingML::WriteSolidFill( const Reference< XPropertySet >& rXPropSet )
     else if ( nFillColor != nOriginalColor )
     {
         // the user has set a different color for the shape
-        WriteSolidFill( ::Color(nFillColor & 0xffffff), nAlpha );
+        WriteSolidFill( ::Color(ColorTransparency, nFillColor & 0xffffff), nAlpha );
     }
     else if ( !sColorFillScheme.isEmpty() )
     {
@@ -492,7 +492,7 @@ void DrawingML::WriteSolidFill( const Reference< XPropertySet >& rXPropSet )
     {
         // the shape had a custom color and the user didn't change it
         // tdf#124013
-        WriteSolidFill( ::Color(nFillColor & 0xffffff), nAlpha );
+        WriteSolidFill( ::Color(ColorTransparency, nFillColor & 0xffffff), nAlpha );
     }
 }
 
@@ -505,7 +505,7 @@ void DrawingML::WriteGradientStop(sal_uInt16 nStop, ::Color nColor, sal_Int32 nA
 
 ::Color DrawingML::ColorWithIntensity( sal_uInt32 nColor, sal_uInt32 nIntensity )
 {
-    return ::Color(( ( ( nColor & 0xff ) * nIntensity ) / 100 )
+    return ::Color(ColorTransparency, ( ( ( nColor & 0xff ) * nIntensity ) / 100 )
         | ( ( ( ( ( nColor & 0xff00 ) >> 8 ) * nIntensity ) / 100 ) << 8 )
         | ( ( ( ( ( nColor & 0xff0000 ) >> 8 ) * nIntensity ) / 100 ) << 8 ));
 }
@@ -918,7 +918,7 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc
         default:
             if (GetProperty(rXPropSet, "LineColor"))
             {
-                nColor = ::Color(mAny.get<sal_uInt32>() & 0xffffff);
+                nColor = ::Color(ColorTransparency, mAny.get<sal_uInt32>() & 0xffffff);
                 bColorSet = true;
             }
             if (GetProperty(rXPropSet, "LineTransparence"))
@@ -1578,7 +1578,7 @@ void DrawingML::WritePattFill(const Reference<XPropertySet>& rXPropSet, const cs
         mpFS->startElementNS(XML_a, XML_pattFill, XML_prst, GetHatchPattern(rHatch));
 
         mpFS->startElementNS(XML_a, XML_fgClr);
-        WriteColor(::Color(rHatch.Color));
+        WriteColor(::Color(ColorTransparency, rHatch.Color));
         mpFS->endElementNS( XML_a , XML_fgClr );
 
         ::Color nColor = COL_WHITE;
@@ -2023,7 +2023,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
             && eState == beans::PropertyState_DIRECT_VALUE)
             || GetProperty(rXPropSet, "CharColor"))
         {
-            ::Color color( *o3tl::doAccess<sal_uInt32>(mAny) );
+            ::Color color( ColorTransparency, *o3tl::doAccess<sal_uInt32>(mAny) );
             SAL_INFO("oox.shape", "run color: " << sal_uInt32(color) << " auto: " << sal_uInt32(COL_AUTO));
 
             // WriteSolidFill() handles MAX_PERCENT as "no transparency".
@@ -2053,7 +2053,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
     {
         if (GetProperty(rXPropSet, "CharBackColor"))
         {
-            ::Color color(*o3tl::doAccess<sal_uInt32>(mAny));
+            ::Color color(ColorTransparency, *o3tl::doAccess<sal_uInt32>(mAny));
             if( color != COL_AUTO )
             {
                 mpFS->startElementNS(XML_a, XML_highlight);
@@ -2069,7 +2069,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
              && eState == beans::PropertyState_DIRECT_VALUE)
             || GetProperty(rXPropSet, "CharUnderlineColor")))
     {
-        ::Color color(*o3tl::doAccess<sal_uInt32>(mAny));
+        ::Color color(ColorTransparency, *o3tl::doAccess<sal_uInt32>(mAny));
         // if color is automatic, then we shouldn't write information about color but to take color from character
         if( color != COL_AUTO )
         {
@@ -2426,7 +2426,7 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS
         }
         else if(aPropName == "BulletColor")
         {
-            nBulletColor = ::Color(*o3tl::doAccess<sal_uInt32>(rPropValue.Value));
+            nBulletColor = ::Color(ColorTransparency, *o3tl::doAccess<sal_uInt32>(rPropValue.Value));
             bHasBulletColor = true;
         }
         else if ( aPropName == "BulletChar" )
@@ -2514,7 +2514,7 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS
         {
                if (nBulletColor == COL_AUTO )
                {
-                   nBulletColor = ::Color(mbIsBackgroundDark ? 0xffffff : 0x000000);
+                   nBulletColor = ::Color(ColorTransparency, mbIsBackgroundDark ? 0xffffff : 0x000000);
                }
                mpFS->startElementNS(XML_a, XML_buClr);
                WriteColor( nBulletColor );
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 58246d08f231..9033e1d40d88 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1805,7 +1805,7 @@ void ShapeExport::WriteBorderLine(const sal_Int32 XML_line, const BorderLine2& r
         if ( rBorderLine.Color == sal_Int32( COL_AUTO ) )
             mpFS->singleElementNS(XML_a, XML_noFill);
         else
-            DrawingML::WriteSolidFill( ::Color(rBorderLine.Color) );
+            DrawingML::WriteSolidFill( ::Color(ColorTransparency, rBorderLine.Color) );
         mpFS->endElementNS( XML_a, XML_line );
     }
 }
diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx
index 1ffbbec89a30..0a50bc23327c 100644
--- a/oox/source/ole/olehelper.cxx
+++ b/oox/source/ole/olehelper.cxx
@@ -81,7 +81,7 @@ sal_uInt32 lclSwapRedBlue( sal_uInt32 nColor )
 /** Returns the UNO RGB color from the passed encoded OLE BGR color. */
 ::Color lclDecodeBgrColor( sal_uInt32 nOleColor )
 {
-    return ::Color( lclSwapRedBlue( nOleColor ) & 0xFFFFFF );
+    return ::Color( ColorTransparency, lclSwapRedBlue( nOleColor ) & 0xFFFFFF );
 }
 
 const sal_uInt32 OLE_STDPIC_ID              = 0x0000746C;
diff --git a/reportdesign/source/core/api/ImageControl.cxx b/reportdesign/source/core/api/ImageControl.cxx
index 1d08baa1aa6a..3260af26e25f 100644
--- a/reportdesign/source/core/api/ImageControl.cxx
+++ b/reportdesign/source/core/api/ImageControl.cxx
@@ -213,7 +213,7 @@ void SAL_CALL OImageControl::setHyperLinkName(const OUString & the_value)
 ::sal_Int32 SAL_CALL OImageControl::getControlBackground()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    return sal_Int32(m_aProps.aFormatProperties.m_bBackgroundTransparent ? COL_TRANSPARENT : m_aProps.aFormatProperties.nBackgroundColor);
+    return m_aProps.aFormatProperties.m_bBackgroundTransparent ? static_cast<sal_Int32>(COL_TRANSPARENT) : m_aProps.aFormatProperties.nBackgroundColor;
 }
 
 void SAL_CALL OImageControl::setControlBackground( ::sal_Int32 _backgroundcolor )
diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx
index cc75f83da045..2ff6228b7ade 100644
--- a/reportdesign/source/core/api/Section.cxx
+++ b/reportdesign/source/core/api/Section.cxx
@@ -245,7 +245,7 @@ void SAL_CALL OSection::setHeight( ::sal_uInt32 _height )
 ::sal_Int32 SAL_CALL OSection::getBackColor()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    return sal_Int32(m_bBacktransparent ? COL_TRANSPARENT : m_nBackgroundColor);
+    return m_bBacktransparent ? static_cast<sal_Int32>(COL_TRANSPARENT) : m_nBackgroundColor;
 }
 
 void SAL_CALL OSection::setBackColor( ::sal_Int32 _backgroundcolor )
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx
index baa7a948f37e..3f440f3494be 100644
--- a/reportdesign/source/ui/dlg/Condition.cxx
+++ b/reportdesign/source/ui/dlg/Condition.cxx
@@ -323,9 +323,9 @@ void Condition::updateToolbar(const uno::Reference< report::XReportControlFormat
         aFont.SetFontHeight(OutputDevice::LogicToLogic(Size(0, aFont.GetFontHeight()), MapMode(MapUnit::MapPoint), MapMode(MapUnit::MapTwip)).Height());
         aFont.SetEmphasisMark( static_cast< FontEmphasisMark >( _xReportControlFormat->getControlTextEmphasis() ) );
         aFont.SetRelief( static_cast< FontRelief >( _xReportControlFormat->getCharRelief() ) );
-        aFont.SetColor( Color(_xReportControlFormat->getCharColor()) );
+        aFont.SetColor( Color(ColorTransparency, _xReportControlFormat->getCharColor()) );
         m_aPreview.SetFont( aFont, aFont, aFont );
-        m_aPreview.SetTextLineColor( Color( _xReportControlFormat->getCharUnderlineColor() ) );
+        m_aPreview.SetTextLineColor( Color( ColorTransparency, _xReportControlFormat->getCharUnderlineColor() ) );
     }
     catch( const Exception& )
     {
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 60b0b48bdb6a..10a7197582d5 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -345,12 +345,12 @@ namespace
         _rItemSet.Put(SvxCharHiddenItem(_rxReportControlFormat->getCharHidden(),ITEMID_CHARHIDDEN));
         _rItemSet.Put(SvxTwoLinesItem(_rxReportControlFormat->getCharCombineIsOn(),_rxReportControlFormat->getCharCombinePrefix().toChar(),_rxReportControlFormat->getCharCombineSuffix().toChar(),ITEMID_TWOLINES));
         SvxUnderlineItem aUnderLineItem(aFont.GetUnderline(),ITEMID_UNDERLINE);
-        aUnderLineItem.SetColor(Color(_rxReportControlFormat->getCharUnderlineColor()));
+        aUnderLineItem.SetColor(Color(ColorTransparency, _rxReportControlFormat->getCharUnderlineColor()));
         _rItemSet.Put(aUnderLineItem);
         _rItemSet.Put(SvxKerningItem(_rxReportControlFormat->getCharKerning(),ITEMID_KERNING));
         _rItemSet.Put(SvxEmphasisMarkItem(static_cast<FontEmphasisMark>(_rxReportControlFormat->getCharEmphasis()),ITEMID_EMPHASISMARK));
         _rItemSet.Put(SvxCharReliefItem(static_cast<FontRelief>(_rxReportControlFormat->getCharRelief()),ITEMID_CHARRELIEF));
-        _rItemSet.Put(SvxColorItem(::Color(_rxReportControlFormat->getCharColor()),ITEMID_COLOR));
+        _rItemSet.Put(SvxColorItem(::Color(ColorTransparency, _rxReportControlFormat->getCharColor()),ITEMID_COLOR));
         _rItemSet.Put(SvxCharRotateItem(Degree10(_rxReportControlFormat->getCharRotation()),false,ITEMID_CHARROTATE));
         _rItemSet.Put(SvxCharScaleWidthItem(_rxReportControlFormat->getCharScaleWidth(),ITEMID_CHARSCALE_W));
 
@@ -363,7 +363,7 @@ namespace
 
         uno::Reference< report::XShape> xShape(_rxReportControlFormat,uno::UNO_QUERY);
         if ( !xShape.is() )
-            _rItemSet.Put(SvxBrushItem(::Color(_rxReportControlFormat->getControlBackground()),ITEMID_BRUSH));
+            _rItemSet.Put(SvxBrushItem(::Color(ColorTransparency, _rxReportControlFormat->getControlBackground()),ITEMID_BRUSH));
 
         lcl_setFont(_rxReportControlFormat, _rItemSet,ASIAN,ITEMID_FONT_ASIAN,ITEMID_FONTHEIGHT_ASIAN,ITEMID_LANGUAGE_ASIAN,ITEMID_POSTURE_ASIAN,ITEMID_WEIGHT_ASIAN );
         lcl_setFont(_rxReportControlFormat, _rItemSet,COMPLEX,ITEMID_FONT_COMPLEX,ITEMID_FONTHEIGHT_COMPLEX,ITEMID_LANGUAGE_COMPLEX,ITEMID_POSTURE_COMPLEX,ITEMID_WEIGHT_COMPLEX );
diff --git a/reportdesign/source/ui/report/FixedTextColor.cxx b/reportdesign/source/ui/report/FixedTextColor.cxx
index 92894cfcb3eb..a73858fcf86a 100644
--- a/reportdesign/source/ui/report/FixedTextColor.cxx
+++ b/reportdesign/source/ui/report/FixedTextColor.cxx
@@ -96,7 +96,7 @@ namespace rptui
         try
         {
             bool bIsDark = false;
-            const Color nBackColor( xFixedText->getControlBackground() );
+            const Color nBackColor( ColorTransparency, xFixedText->getControlBackground() );
             if (nBackColor == COL_TRANSPARENT)
             {
                 uno::Reference <report::XSection> xSection(xFixedText->getParent(), uno::UNO_QUERY_THROW);
@@ -112,7 +112,7 @@ namespace rptui
                 else
                 {
                     css::util::Color aColor2 = xSection->getBackColor();
-                    Color aBackColor(aColor2);
+                    Color aBackColor(ColorTransparency, aColor2);
                     bIsDark = aBackColor.IsDark();
                 }
             }
@@ -132,7 +132,7 @@ namespace rptui
             else
             {
                 util::Color aLabelColor = xFixedText->getCharColor();
-                setPropertyTextColor(xVclWindowPeer, ::Color(aLabelColor));
+                setPropertyTextColor(xVclWindowPeer, ::Color(ColorTransparency, aLabelColor));
             }
 
         }
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 5f5386555a2e..40cc8421c5d8 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2421,7 +2421,7 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
         ::std::unique_ptr<SfxItemSet> pDescriptor(new SfxItemSet(*pPool, pRanges));
         // fill it
         if ( _xSection.is() )
-            pDescriptor->Put(SvxBrushItem(::Color(_xSection->getBackColor()),RPTUI_ID_BRUSH));
+            pDescriptor->Put(SvxBrushItem(::Color(ColorTransparency, _xSection->getBackColor()),RPTUI_ID_BRUSH));
         else
         {
             pDescriptor->Put(SvxSizeItem(RPTUI_ID_SIZE,VCLSize(getStyleProperty<awt::Size>(m_xReportDefinition,PROPERTY_PAPERSIZE))));
@@ -2441,7 +2441,7 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
                 aPageItem.SetLandscape(getStyleProperty<bool>(m_xReportDefinition,PROPERTY_ISLANDSCAPE));
                 aPageItem.SetNumType(static_cast<SvxNumType>(getStyleProperty<sal_Int16>(m_xReportDefinition,PROPERTY_NUMBERINGTYPE)));
                 pDescriptor->Put(aPageItem);
-                pDescriptor->Put(SvxBrushItem(::Color(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_BACKCOLOR)),RPTUI_ID_BRUSH));
+                pDescriptor->Put(SvxBrushItem(::Color(ColorTransparency, getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_BACKCOLOR)),RPTUI_ID_BRUSH));
             }
         }
 
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index a1ea65141ae2..5ea227f5e184 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -206,7 +206,7 @@ void OReportSection::fill()
     sal_Int32 nColor = m_xSection->getBackColor();
     if ( nColor == static_cast<sal_Int32>(COL_TRANSPARENT) )
         nColor = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_BACKCOLOR);
-    m_pView->SetApplicationDocumentColor(Color(nColor));
+    m_pView->SetApplicationDocumentColor(Color(ColorTransparency, nColor));
 
     uno::Reference<report::XReportDefinition> xReportDefinition = m_xSection->getReportDefinition();
     const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
@@ -454,7 +454,7 @@ void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent)
         sal_Int32 nColor = m_xSection->getBackColor();
         if ( nColor == static_cast<sal_Int32>(COL_TRANSPARENT) )
             nColor = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_BACKCOLOR);
-        m_pView->SetApplicationDocumentColor(Color(nColor));
+        m_pView->SetApplicationDocumentColor(Color(ColorTransparency, nColor));
         Invalidate(InvalidateFlags::NoChildren|InvalidateFlags::NoErase);
     }
     else
diff --git a/sc/qa/extras/new_cond_format.cxx b/sc/qa/extras/new_cond_format.cxx
index 817b4c6c9eab..257d2e7f92be 100644
--- a/sc/qa/extras/new_cond_format.cxx
+++ b/sc/qa/extras/new_cond_format.cxx
@@ -356,7 +356,7 @@ void testColorScaleEntry(uno::Reference<sheet::XColorScaleEntry> const & xEntry,
         sal_Int32 nType, const OUString& rString, Color nColor)
 {
     CPPUNIT_ASSERT_EQUAL(nType, xEntry->getType());
-    CPPUNIT_ASSERT_EQUAL(nColor, Color(xEntry->getColor()));
+    CPPUNIT_ASSERT_EQUAL(nColor, Color(ColorTransparency, xEntry->getColor()));
     switch (nType)
     {
         case sheet::ColorScaleEntryType::COLORSCALE_VALUE:
diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx
index d71d59a3b66b..fda7236be3c6 100644
--- a/sc/source/core/tool/appoptio.cxx
+++ b/sc/source/core/tool/appoptio.cxx
@@ -422,16 +422,16 @@ ScAppCfg::ScAppCfg() :
                 switch(nProp)
                 {
                     case SCREVISOPT_CHANGE:
-                        if (pValues[nProp] >>= nIntVal) SetTrackContentColor( Color(nIntVal) );
+                        if (pValues[nProp] >>= nIntVal) SetTrackContentColor( Color(ColorTransparency, nIntVal) );
                         break;
                     case SCREVISOPT_INSERTION:
-                        if (pValues[nProp] >>= nIntVal) SetTrackInsertColor( Color(nIntVal) );
+                        if (pValues[nProp] >>= nIntVal) SetTrackInsertColor( Color(ColorTransparency, nIntVal) );
                         break;
                     case SCREVISOPT_DELETION:
-                        if (pValues[nProp] >>= nIntVal) SetTrackDeleteColor( Color(nIntVal) );
+                        if (pValues[nProp] >>= nIntVal) SetTrackDeleteColor( Color(ColorTransparency, nIntVal) );
                         break;
                     case SCREVISOPT_MOVEDENTRY:
-                        if (pValues[nProp] >>= nIntVal) SetTrackMoveColor( Color(nIntVal) );
+                        if (pValues[nProp] >>= nIntVal) SetTrackMoveColor( Color(ColorTransparency, nIntVal) );
                         break;
                 }
             }
diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx
index 3678e1866a17..45b06b47a1fa 100644
--- a/sc/source/core/tool/viewopti.cxx
+++ b/sc/source/core/tool/viewopti.cxx
@@ -294,9 +294,12 @@ ScViewCfg::ScViewCfg() :
                 switch(nProp)
                 {
                     case SCLAYOUTOPT_GRIDCOLOR:
-                        if ( pValues[nProp] >>= nIntVal )
-                            SetGridColor( Color(nIntVal), EMPTY_OUSTRING );
+                    {
+                        Color aColor;
+                        if ( pValues[nProp] >>= aColor )
+                            SetGridColor( aColor, EMPTY_OUSTRING );
                         break;
+                    }
                     case SCLAYOUTOPT_GRIDLINES:
                         SetOption( VOPT_GRID, ScUnoHelpFunctions::GetBoolFromAny( pValues[nProp] ) );
                         break;
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index f02c37bee841..18647bbd3c02 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -880,7 +880,7 @@ sax_fastparser::FSHelperPtr XclXmlUtils::WriteFontData( sax_fastparser::FSHelper
     lcl_WriteValue( pStream, XML_u,          bHaveUnderline           ? pUnderline    : nullptr );
     lcl_WriteValue( pStream, XML_vertAlign,  bHaveVertAlign           ? pVertAlign    : nullptr );
     lcl_WriteValue( pStream, XML_sz,         OString::number( rFontData.mnHeight / 20.0 ).getStr() );  // Twips->Pt
-    if( rFontData.maColor != Color( 0xFF, 0xFF, 0xFF, 0xFF ) )
+    if( rFontData.maColor != Color( ColorAlpha, 0, 0xFF, 0xFF, 0xFF ) )
         pStream->singleElement( XML_color,
                 // OOXTODO: XML_auto,       bool
                 // OOXTODO: XML_indexed,    uint
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 031639564a78..a138f62c3d44 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1834,7 +1834,7 @@ static void lcl_WriteBorder( XclExpXmlStream& rStrm, sal_Int32 nElement, sal_uIn
     sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream();
     if( nLineStyle == EXC_LINE_NONE )
         rStyleSheet->singleElement(nElement);
-    else if( rColor == Color( 0, 0, 0, 0 ) )
+    else if( rColor == Color( 0, 0, 0 ) )
         rStyleSheet->singleElement(nElement, XML_style, ToLineStyle(nLineStyle));
     else
     {
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index 3503ba9567fe..3a178c10dc06 100644
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -886,8 +886,8 @@ void XclChPropSetHelper::ReadMarkerProperties(
     rMarkerFmt.mnMarkerSize = XclTools::GetTwipsFromHmm( nApiSize );
 
     // symbol colors
-    rMarkerFmt.maLineColor = Color( aApiSymbol.BorderColor );
-    rMarkerFmt.maFillColor = Color( aApiSymbol.FillColor );
+    rMarkerFmt.maLineColor = Color( ColorTransparency, aApiSymbol.BorderColor );
+    rMarkerFmt.maFillColor = Color( ColorTransparency, aApiSymbol.FillColor );
 }
 
 sal_uInt16 XclChPropSetHelper::ReadRotationProperties( const ScfPropertySet& rPropSet, bool bSupportsStacked )
diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx
index b5833a697b5d..a1271eb81602 100644
--- a/sc/source/filter/ftools/fapihelper.cxx
+++ b/sc/source/filter/ftools/fapihelper.cxx
@@ -202,7 +202,7 @@ bool ScfPropertySet::GetColorProperty( Color& rColor, const OUString& rPropName
 {
     sal_Int32 nApiColor = 0;
     bool bRet = GetProperty( nApiColor, rPropName );
-    rColor = Color( nApiColor );
+    rColor = Color( ColorTransparency, nApiColor );
     return bRet;
 }
 
@@ -320,7 +320,7 @@ void ScfPropSetHelper::ReadValue( Color& rColor )
 {
     sal_Int32 nApiColor(0);
     ReadValue( nApiColor );
-    rColor = Color( nApiColor );
+    rColor = Color( ColorTransparency, nApiColor );
 }
 
 void ScfPropSetHelper::ReadValue( bool& rbValue )
diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx
index d8c60dad324d..3746a26230dd 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -235,7 +235,7 @@ private:
 
 struct ExCfRuleModel
 {
-    ExCfRuleModel() : mnAxisColor( UNSIGNED_RGB_TRANSPARENT ), mnNegativeColor( UNSIGNED_RGB_TRANSPARENT ), mbGradient( false ), mbIsLower( true ) {}
+    ExCfRuleModel() : mnAxisColor( ColorTransparency, UNSIGNED_RGB_TRANSPARENT ), mnNegativeColor( ColorTransparency, UNSIGNED_RGB_TRANSPARENT ), mbGradient( false ), mbIsLower( true ) {}
     // AxisColor
     ::Color mnAxisColor;
     // NegativeFillColor
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index ca28b0ebf818..13ca11ed9333 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -172,7 +172,7 @@ namespace {
 {
     ::Color nColor;
     if( rAttribs.hasAttribute( XML_rgb ) )
-        nColor = ::Color(rAttribs.getUnsignedHex( XML_rgb, UNSIGNED_RGB_TRANSPARENT ));
+        nColor = ::Color(ColorTransparency, rAttribs.getUnsignedHex( XML_rgb, UNSIGNED_RGB_TRANSPARENT ));
     else if( rAttribs.hasAttribute( XML_theme ) )
     {
         sal_uInt32 nThemeIndex = rAttribs.getUnsigned( XML_theme, 0 );
diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx
index d6fd828c79dd..bc80fc42a1f8 100644
--- a/sc/source/filter/oox/pagesettings.cxx
+++ b/sc/source/filter/oox/pagesettings.cxx
@@ -855,7 +855,7 @@ void HeaderFooterParser::convertFontColor( const OUString& rColor )
             static_cast< double >( rColor.copy( 2 ).toInt32() ) / 100.0 );
     else
         // RGB color: RRGGBB
-        maFontModel.maColor.setRgb( ::Color(rColor.toUInt32( 16 )) );
+        maFontModel.maColor.setRgb( ::Color(ColorTransparency, rColor.toUInt32( 16 )) );
 }
 
 void HeaderFooterParser::finalizePortion()
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index e688a5221e48..17cf305392e2 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -219,7 +219,7 @@ const sal_uInt8 BIFF_FONTUNDERL_DOUBLE_ACC  = 34;
     nValue |= nG;
     nValue <<= 8;
     nValue |= nB;
-    return ::Color(nValue);
+    return ::Color(ColorTransparency, nValue);
 }
 
 } // namespace
@@ -277,7 +277,7 @@ void Color::importColor( const AttributeList& rAttribs )
     if( rAttribs.hasAttribute( XML_theme ) )
         setTheme( rAttribs.getInteger( XML_theme, -1 ), rAttribs.getDouble( XML_tint, 0.0 ) );
     else if( rAttribs.hasAttribute( XML_rgb ) )
-        setRgb( rAttribs.getIntegerHex( XML_rgb, sal_Int32(API_RGB_TRANSPARENT) ), rAttribs.getDouble( XML_tint, 0.0 ) );
+        setRgb( ::Color(ColorTransparency, rAttribs.getIntegerHex( XML_rgb, sal_Int32(API_RGB_TRANSPARENT) ) ), rAttribs.getDouble( XML_tint, 0.0 ) );
     else if( rAttribs.hasAttribute( XML_indexed ) )
         setIndexed( rAttribs.getInteger( XML_indexed, -1 ), rAttribs.getDouble( XML_tint, 0.0 ) );
     else if( rAttribs.getBool( XML_auto, false ) )
@@ -377,7 +377,7 @@ ColorPalette::ColorPalette( const WorkbookHelper& rHelper )
 
 void ColorPalette::importPaletteColor( const AttributeList& rAttribs )
 {
-    appendColor( rAttribs.getIntegerHex( XML_rgb, sal_Int32(API_RGB_WHITE) ) );
+    appendColor( ::Color(ColorTransparency, rAttribs.getIntegerHex( XML_rgb, sal_Int32(API_RGB_WHITE) ) ) );
 }
 
 void ColorPalette::importPaletteColor( SequenceInputStream& rStrm )
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 7bf9bd059def..49ea4d07a2b3 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -1727,7 +1727,7 @@ void ScOrcusStyles::set_font_underline_color(orcus::spreadsheet::color_elem_t al
             orcus::spreadsheet::color_elem_t green,
             orcus::spreadsheet::color_elem_t blue)
 {
-    maCurrentFont.maUnderlineColor = Color(alpha, red, green, blue);
+    maCurrentFont.maUnderlineColor = Color(ColorTransparency, alpha, red, green, blue);
 }
 
 void ScOrcusStyles::set_font_color(orcus::spreadsheet::color_elem_t /*alpha*/,
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 3bfa5bbdc1e8..60d3b2114e29 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -85,7 +85,7 @@ namespace
             if (sColor == "transparent")
                 aColor = COL_TRANSPARENT;
             else
-                aColor = Color(sColor.toInt32(16));
+                aColor = Color(ColorTransparency, sColor.toInt32(16));
 
             switch (nSlot)
             {
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index ca3713ef46f8..1b2ef3240c1e 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -333,7 +333,7 @@ static void setupFillColorForChart(SfxViewShell* pShell, SfxItemSet& rSet)
                                 sal_uInt32 nFillColor = 0;
                                 xPropSet->getPropertyValue("FillColor") >>= nFillColor;
 
-                                XFillColorItem aFillColorItem("", Color(nFillColor));
+                                XFillColorItem aFillColorItem("", Color(ColorTransparency, nFillColor));
                                 rSet.Put(aFillColorItem);
 
                                 if (comphelper::LibreOfficeKit::isActive())
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 4647b2bd3b4e..a12d8d1c9f2f 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -7877,17 +7877,15 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
     {
         if (rDoc.IsScenario(nTab))
         {
-            sal_Int32 nNewColor = 0;
-            if (aValue >>= nNewColor)
+            Color aColor;
+            if (aValue >>= aColor)
             {
                 OUString aName;
                 OUString aComment;
-                Color  aColor;
                 ScScenarioFlags nFlags;
+                Color aTmp;
                 rDoc.GetName( nTab, aName );
-                rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
-
-                aColor = Color(static_cast<sal_uInt32>(nNewColor));
+                rDoc.GetScenarioData( nTab, aComment, aTmp, nFlags );
 
                 pDocSh->ModifyScenario( nTab, aName, aComment, aColor, nFlags );
             }
diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx
index c679f423bb48..b64fd3ec96b6 100644
--- a/sc/source/ui/unoobj/condformatuno.cxx
+++ b/sc/source/ui/unoobj/condformatuno.cxx
@@ -886,7 +886,7 @@ void setColorScaleEntry(ScColorScaleEntry* pEntry, uno::Reference<sheet::XColorS
         throw lang::IllegalArgumentException();
 
     pEntry->SetType(eType);
-    pEntry->SetColor(Color(xEntry->getColor()));
+    pEntry->SetColor(Color(ColorTransparency, xEntry->getColor()));
     switch (eType)
     {
         case COLORSCALE_FORMULA:
@@ -1020,7 +1020,7 @@ sal_Int32 ScColorScaleEntryObj::getColor()
 
 void ScColorScaleEntryObj::setColor(sal_Int32 aColor)
 {
-    getCoreObject()->SetColor(Color(aColor));
+    getCoreObject()->SetColor(Color(ColorTransparency, aColor));
 }
 
 sal_Int32 ScColorScaleEntryObj::getType()
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 5e06f7b1afb2..b95566ed667f 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -155,12 +155,9 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
         aViewOpt.SetOption(VOPT_GRID, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
     else if ( aPropertyName == SC_UNO_GRIDCOLOR )
     {
-        sal_Int64 nColor = 0;
-        if (aValue >>= nColor)
-        {
-            Color aColor(static_cast<sal_uInt32>(nColor));
+        Color aColor;
+        if (aValue >>= aColor)
             aViewOpt.SetGridColor(aColor, OUString());
-        }
     }
     else if ( aPropertyName == SC_UNO_SHOWPAGEBR )
         aViewOpt.SetOption(VOPT_PAGEBREAKS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx
index 34998adcbb16..b4366a4e1897 100644
--- a/sc/source/ui/vba/vbaborders.cxx
+++ b/sc/source/ui/vba/vbaborders.cxx
@@ -165,7 +165,7 @@ public:
     {
         table::BorderLine aBorderLine;
         if ( getBorderLine( aBorderLine ) )
-            return uno::makeAny( OORGBToXLRGB( Color(aBorderLine.Color) ) );
+            return uno::makeAny( OORGBToXLRGB( Color(ColorTransparency, aBorderLine.Color) ) );
         throw uno::RuntimeException("No Implementation available" );
     }
     void SAL_CALL setColor( const uno::Any& _color ) override
diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx
index c4f83e972789..241099a00624 100644
--- a/sc/source/ui/vba/vbainterior.cxx
+++ b/sc/source/ui/vba/vbainterior.cxx
@@ -102,7 +102,7 @@ ScVbaInterior::SetMixedColor()
     if( aPatternColor.hasValue() )
     {
         sal_uInt32 nPatternColor = GetAttributeData( aPatternColor );
-        m_aPattColor = Color(nPatternColor);
+        m_aPattColor = Color(ColorTransparency, nPatternColor);
     }
     Color nPatternColor = m_aPattColor;
     // back color
@@ -216,7 +216,7 @@ Color
 ScVbaInterior::GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8 nTrans )
 {
     return Color(
-        nTrans,
+        ColorTransparency, nTrans,
         GetMixedColorComp( rFore.GetRed(), rBack.GetRed(), nTrans ),
         GetMixedColorComp( rFore.GetGreen(), rBack.GetGreen(), nTrans ),
         GetMixedColorComp( rFore.GetBlue(), rBack.GetBlue(), nTrans ));
@@ -301,7 +301,7 @@ ScVbaInterior::GetBackColor()
     if( aColor.hasValue() )
     {
         nColor = GetAttributeData( aColor );
-        aBackColor = Color(nColor);
+        aBackColor = Color(ColorTransparency, nColor);
     }
     else
     {
@@ -309,7 +309,7 @@ ScVbaInterior::GetBackColor()
         if( aAny >>= nColor )
         {
             nColor = XLRGBToOORGB( nColor );
-            aBackColor = Color(nColor);
+            aBackColor = Color(ColorTransparency, nColor);
             SetUserDefinedAttributes( BACKCOLOR, SetAttributeData( nColor ) );
         }
     }
@@ -323,7 +323,7 @@ ScVbaInterior::getPatternColor()
     if( aPatternColor.hasValue() )
     {
         sal_uInt32 nPatternColor = GetAttributeData( aPatternColor );
-        return uno::makeAny( OORGBToXLRGB( Color(nPatternColor) ) );
+        return uno::makeAny( OORGBToXLRGB( Color(ColorTransparency, nPatternColor) ) );
     }
     return uno::makeAny( sal_Int32( 0 ) );
 }
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 4b1b414f329e..7e22423f28a5 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -956,7 +956,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
                         if ( sColor == "transparent" )
                             aColor = COL_TRANSPARENT;
                         else
-                            aColor = Color( sColor.toInt32( 16 ) );
+                            aColor = Color( ColorTransparency, sColor.toInt32( 16 ) );
 
                         aSet.Put( SvxColorItem( aColor, EE_CHAR_COLOR ) );
                     }
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 9b38ac794412..865b129c6610 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1644,7 +1644,7 @@ namespace
             if (sColor == "transparent")
                 rColor = COL_TRANSPARENT;
             else
-                rColor = Color(sColor.toInt32(16));
+                rColor = Color(ColorTransparency, sColor.toInt32(16));
             return true;
         }
         return false;
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 29b699a96eb6..ba73413c7fc2 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -2551,7 +2551,7 @@ void ScTabView::DoChartSelection(
 
     for (chart2::data::HighlightedRange const & rHighlightedRange : rHilightRanges)
     {
-        Color aSelColor(rHighlightedRange.PreferredColor);
+        Color aSelColor(ColorTransparency, rHighlightedRange.PreferredColor);
         ScRangeList aRangeList;
         ScDocument& rDoc = aViewData.GetDocShell()->GetDocument();
         if( ScRangeStringConverter::GetRangeListFromString(
diff --git a/sd/source/filter/eppt/pptx-stylesheet.cxx b/sd/source/filter/eppt/pptx-stylesheet.cxx
index 27fc7f3ac598..459020278fc9 100644
--- a/sd/source/filter/eppt/pptx-stylesheet.cxx
+++ b/sd/source/filter/eppt/pptx-stylesheet.cxx
@@ -79,7 +79,7 @@ void PPTExCharSheet::SetStyleSheet( const css::uno::Reference< css::beans::XProp
     PPTExCharLevel& rLev = maCharLevel[ nLevel ];
 
     if ( aPortionObj.meCharColor == css::beans::PropertyState_DIRECT_VALUE )
-        rLev.mnFontColor = aPortionObj.mnCharColor;
+        rLev.mnFontColor = Color(ColorTransparency, aPortionObj.mnCharColor);
     if ( aPortionObj.meCharEscapement == css::beans::PropertyState_DIRECT_VALUE )
         rLev.mnEscapement = aPortionObj.mnCharEscapement;
     if ( aPortionObj.meCharHeight == css::beans::PropertyState_DIRECT_VALUE )
@@ -111,7 +111,7 @@ void PPTExCharSheet::Write( SvStream& rSt, sal_uInt16 nLev, bool bSimpleText,
         css::uno::Any aAny;
         if ( PropValue::GetPropertyValue( aAny, rPagePropSet, "IsBackgroundDark", true ) )
             aAny >>= bIsDark;
-        nFontColor = bIsDark ? 0xffffff : 0x000000;
+        nFontColor = Color(ColorTransparency, bIsDark ? 0xffffff : 0x000000);
     }
     nFontColor.SetAlpha(1);
     if ( bSimpleText )
@@ -447,7 +447,7 @@ bool PPTExStyleSheet::IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLevel,
         case CharAttr_AsianOrComplexFont : return ( rChar.mnAsianOrComplexFont != nValue );
         case CharAttr_Symbol : return true;
         case CharAttr_FontHeight : return ( rChar.mnFontHeight != nValue );
-        case CharAttr_FontColor : return ( rChar.mnFontColor != nValue );
+        case CharAttr_FontColor : return ( rChar.mnFontColor != Color(ColorTransparency, nValue) );
         case CharAttr_Escapement : return ( rChar.mnEscapement != nValue );
         default:
             break;
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index c7819eafa3a9..87d90336e554 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -499,37 +499,37 @@ void HtmlExport::InitExportParameters( const Sequence< PropertyValue >& rParams
         }
         else if ( rParam.Name == "BackColor" )
         {
-            sal_Int32 temp = 0;
+            Color temp;
             rParam.Value >>= temp;
-            maBackColor = Color(temp);
+            maBackColor = temp;
             mbUserAttr = true;
         }
         else if ( rParam.Name == "TextColor" )
         {
-            sal_Int32 temp = 0;
+            Color temp;
             rParam.Value >>= temp;
-            maTextColor = Color(temp);
+            maTextColor = temp;
             mbUserAttr = true;
         }
         else if ( rParam.Name == "LinkColor" )
         {
-            sal_Int32 temp = 0;
+            Color temp ;
             rParam.Value >>= temp;
-            maLinkColor = Color(temp);
+            maLinkColor = temp;
             mbUserAttr = true;
         }
         else if ( rParam.Name == "VLinkColor" )
         {
-            sal_Int32 temp = 0;
+            Color temp;
             rParam.Value >>= temp;
-            maVLinkColor = Color(temp);
+            maVLinkColor = temp;
             mbUserAttr = true;
         }
         else if ( rParam.Name == "ALinkColor" )
         {
-            sal_Int32 temp = 0;
+            Color temp;
             rParam.Value >>= temp;
-            maALinkColor = Color(temp);
+            maALinkColor = temp;
             mbUserAttr = true;
         }
         else if ( rParam.Name == "IsUseDocumentColors" )
diff --git a/sd/source/filter/ppt/ppt97animations.cxx b/sd/source/filter/ppt/ppt97animations.cxx
index 96d578019753..cc0b37afd913 100644
--- a/sd/source/filter/ppt/ppt97animations.cxx
+++ b/sd/source/filter/ppt/ppt97animations.cxx
@@ -35,7 +35,7 @@ void Ppt97AnimationInfoAtom::ReadStream( SvStream& rIn )
 {
     sal_uInt32 nTmp;
     rIn.ReadUInt32( nTmp );
-    nDimColor = Color(nTmp);
+    nDimColor = Color(ColorTransparency, nTmp);
     rIn.ReadUInt32( nFlags );
     rIn.ReadUInt32( nSoundRef );
     rIn.ReadInt32( nDelayTime );
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index a4b247662855..fb8a5bc68efd 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -208,9 +208,9 @@ SdColorPropertyBox::SdColorPropertyBox(weld::Label* pLabel, weld::Container* pPa
     pLabel->set_mnemonic_widget(&mxControl->get_widget());
     mxControl->show();
 
-    sal_Int32 nColor = 0;
+    Color nColor;
     rValue >>= nColor;
-    mxControl->SelectEntry(Color(nColor));
+    mxControl->SelectEntry(nColor);
 }
 
 IMPL_LINK_NOARG(SdColorPropertyBox, OnSelect, ColorListBox&, void)
@@ -222,11 +222,11 @@ void SdColorPropertyBox::setValue( const Any& rValue, const OUString& )
 {
     if (mxControl)
     {
-        sal_Int32 nColor = 0;
+        Color nColor;
         rValue >>= nColor;
 
         mxControl->SetNoSelection();
-        mxControl->SelectEntry(Color(nColor));
+        mxControl->SelectEntry(nColor);
     }
 }
 
@@ -1000,9 +1000,8 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage(weld::Container* pPar
 
             if( aDimColor.hasValue() )
             {
-                sal_Int32 nColor = 0;
-                aDimColor >>= nColor;
-                Color aColor(nColor);
+                Color aColor;
+                aDimColor >>= aColor;
                 mxCLBDimColor->SelectEntry(aColor);
             }
             else
diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx
index 5de5d71bcd8d..89eb7992ea73 100644
--- a/sd/source/ui/dlg/copydlg.cxx
+++ b/sd/source/ui/dlg/copydlg.cxx
@@ -169,8 +169,8 @@ void CopyDlg::Reset()
         m_xMtrFldAngle->set_value(aStr.getToken(0, TOKEN, nIdx).toInt64(), FieldUnit::NONE);
         m_xMtrFldWidth->set_value(aStr.getToken(0, TOKEN, nIdx).toInt64(), FieldUnit::NONE);
         m_xMtrFldHeight->set_value(aStr.getToken(0, TOKEN, nIdx).toInt64(), FieldUnit::NONE);
-        m_xLbStartColor->SelectEntry( Color( aStr.getToken(0, TOKEN, nIdx).toUInt32() ) );
-        m_xLbEndColor->SelectEntry( Color( aStr.getToken(0, TOKEN, nIdx).toUInt32() ) );
+        m_xLbStartColor->SelectEntry( Color( ColorTransparency, aStr.getToken(0, TOKEN, nIdx).toUInt32() ) );
+        m_xLbEndColor->SelectEntry( Color( ColorTransparency, aStr.getToken(0, TOKEN, nIdx).toUInt32() ) );
     }
 
 }
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx
index 46daeb6f061d..4a3301bbefc4 100644
--- a/sd/source/ui/presenter/PresenterTextView.cxx
+++ b/sd/source/ui/presenter/PresenterTextView.cxx
@@ -161,15 +161,15 @@ Any PresenterTextView::SetPropertyValue (
     }
     else if (rsPropertyName == gsBackgroundColorPropertyName)
     {
-        util::Color aColor = util::Color();
+        ::Color aColor;
         if (rValue >>= aColor)
-            mpImplementation->SetBackgroundColor(Color(aColor));
+            mpImplementation->SetBackgroundColor(aColor);
     }
     else if (rsPropertyName == gsTextColorPropertyName)
     {
-        util::Color aColor = util::Color();
+        ::Color aColor;
         if (rValue >>= aColor)
-            mpImplementation->SetTextColor(Color(aColor));
+            mpImplementation->SetTextColor(aColor);
     }
     else if (rsPropertyName == gsFontDescriptorPropertyName)
     {
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 5b4574261934..77bab18a6c70 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -1417,7 +1417,7 @@ void SAL_CALL SlideshowImpl::blankScreen( sal_Int32 nColor )
 
     if( mpShowWindow && mpSlideController )
     {
-        if( mpShowWindow->SetBlankMode( mpSlideController->getCurrentSlideIndex(), Color(nColor) ) )
+        if( mpShowWindow->SetBlankMode( mpSlideController->getCurrentSlideIndex(), Color(ColorTransparency, nColor) ) )
         {
             pause();
         }
@@ -2107,7 +2107,7 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu, bool )
     else if (sMenuId == "color")
     {
         //Open a color picker based on SvColorDialog
-        ::Color aColor( mnUserPaintColor );
+        ::Color aColor( ColorTransparency, mnUserPaintColor );
         SvColorDialog aColorDlg;
         aColorDlg.SetColor( aColor );
 
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterService.cxx b/sd/source/ui/slidesorter/shell/SlideSorterService.cxx
index cd9b167d6eff..41d05c37f0b3 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorterService.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterService.cxx
@@ -310,7 +310,7 @@ void SAL_CALL SlideSorterService::setBackgroundColor (sal_Int32 aBackgroundColor
 {
     ThrowIfDisposed();
     if (mpSlideSorter != nullptr && mpSlideSorter->IsValid())

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list