sc/source/ui/app/rfindlst.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 9c8b240e7cad6ef74e16ad83d45957737389aa90
Author:     Heiko Tietze <tietze.he...@gmail.com>
AuthorDate: Thu Mar 21 11:50:40 2024 +0100
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Fri Mar 22 13:06:37 2024 +0100

    Resolves tdf#160282 - Ranges references text colors for dark backgrounds
    
    Change-Id: I3d3bb22302ad5016c962d606e80c2e9942301fbd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165095
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/sc/source/ui/app/rfindlst.cxx b/sc/source/ui/app/rfindlst.cxx
index ba17bf006ea1..be521f65dea8 100644
--- a/sc/source/ui/app/rfindlst.cxx
+++ b/sc/source/ui/app/rfindlst.cxx
@@ -20,18 +20,25 @@
 #include <rfindlst.hxx>
 #include <tools/debug.hxx>
 #include <utility>
+#include <svtools/colorcfg.hxx>
+#include <scmod.hxx>
 
 #define SC_RANGECOLORS  8
 
 const Color aColNames[SC_RANGECOLORS] =
     { COL_LIGHTBLUE, COL_LIGHTRED, COL_LIGHTMAGENTA, COL_GREEN,
         COL_BLUE, COL_RED, COL_MAGENTA, COL_BROWN };
+const Color aDarkColNames[SC_RANGECOLORS] =
+    { COL_LIGHTBLUE, COL_LIGHTRED, COL_LIGHTMAGENTA, COL_GREEN,
+        Color(0xb4c7dc), Color(0xffa6a6), Color(0xffb66c), Color(0xafd095) }; 
//light blue/red/orange/green 3
+static bool bIsDark;
 
 ScRangeFindList::ScRangeFindList(OUString aName) :
     aDocName(std::move( aName )),
     bHidden( false ),
     nIndexColor( 0 )
 {
+    bIsDark = 
SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor.IsDark();
 }
 
 Color ScRangeFindList::Insert( const ScRangeFindData &rNew )
@@ -48,7 +55,8 @@ Color ScRangeFindList::Insert( const ScRangeFindData &rNew )
 
 Color ScRangeFindList::GetColorName( const size_t nIndex )
 {
-    return aColNames[nIndex % SC_RANGECOLORS];
+    return bIsDark ? aDarkColNames[nIndex % SC_RANGECOLORS]
+                   : aColNames[nIndex % SC_RANGECOLORS];
 }
 
 Color ScRangeFindList::FindColor( const ScRange& rRef, const size_t nIndex )

Reply via email to