diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index 55e6500577d2..c150c5fc72f5 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -89,8 +90,13 @@ static void RGBtoCMYK( double dR, double dG, double dB, double& fCyan, double& f void ColorPreviewControl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) { - rRenderContext.SetFillColor(m_aColor); - rRenderContext.SetLineColor(m_aColor); + Color aCol = m_aColor; + // If the color has been set to transparent, we need to paint a block that matches the dialog + // background. + if (aCol.GetAlpha() == 0) + aCol = Application::GetSettings().GetStyleSettings().GetDialogColor(); + rRenderContext.SetFillColor(aCol); + rRenderContext.SetLineColor(aCol); rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), GetOutputSizePixel())); }