Re: [LyX/master] Upgrade ColorSet class to be based on 32bit colors

Enrico Forestieri <[email protected]> Wed, 3 Jun 2026 11:35:24 +0200
Newsgroups gmane.editors.lyx.devel
Message-ID <ah_1XN4kcnubp7XU@DRACO>
On Tue, Jun 02, 2026 at 04:51:32AM +0000, Koji Yokota wrote:
>commit abdb06e5f64f1d6f78bdd58552b8d2bf3c63db3f
>Author: Koji Yokota <[email protected]>
>Date:   Sun May 31 22:03:22 2026 +0900
>
>    Upgrade ColorSet class to be based on 32bit colors
>---
> src/Color.cpp                   | 270 +++++++++++++++++++++++++---------------
> src/Color.h                     |   7 +-
> src/ColorSet.h                  |  26 ++--
> src/LyXRC.cpp                   |   8 +-
> src/frontends/qt/ColorCache.cpp |   8 +-
> src/frontends/qt/GuiPrefs.cpp   |   2 +-
> 6 files changed, 202 insertions(+), 119 deletions(-)
>
>diff --git a/src/Color.cpp b/src/Color.cpp
>index 6c3387fe41..f277de10b4 100644
>--- a/src/Color.cpp
>+++ b/src/Color.cpp
[snip]
>@@ -468,15 +522,30 @@ bool ColorSet::setColor(ColorCode col, string 
>const & x11hexname,
> 		return false;
> 	}
>
>-	if (!x11hexname.empty())
>-		it->second.x11hexname = x11hexname;
>-	it->second.x11darkhexname = (x11darkhexname.empty()) ? x11hexname : x11darkhexname;
>+	LASSERT((hexname.empty()
>+	         || ((hexname.size() == 7 || hexname.size() == 9)
>+	             && hexname[0] == '#'))
>+	        && (darkhexname.empty()
>+	            || ((darkhexname.size() == 7 || darkhexname.size() == 9)
>+	                && darkhexname[0] == '#')),
>+	        return true);

Please, note that this assertion triggers when you (for example) have
\set_color "note" "DarkGoldenrod"
in the preferences.

-- 
Enrico
-- 
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel