commit 90bd9c49fc4a2660356d57faaf678ab8dc9a1dd3
Author: Koji Yokota <[email protected]>
Date: Thu Jul 30 17:03:18 2026 +0900
Bump up the format number to support ARGB colors
---
development/FORMAT | 8 ++++++++
lib/lyx2lyx/lyx_2_6.py | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
src/version.h | 4 ++--
3 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/development/FORMAT b/development/FORMAT
index 9ffd2926b4..0e9e95f012 100644
--- a/development/FORMAT
+++ b/development/FORMAT
@@ -7,6 +7,14 @@ changes happened in particular if possible. A good example
would be
-----------------------
+2026-07-30 Koji Yokota <[email protected]>
+ * Format incremented to 655:
+ Support ARGB colors. \color now takes 32bit hexnames instead of 16bit
+ in the form of:
+ \color <#AARRGGBB> <#AARRGGBB>
+ where the first and second arguments are light and dark colors,
+ respectively.
+
2026-07-24 Jürgen Spitzmüller <[email protected]>
* Format incremented to 654: Support some specific minted languages.
- These have other names than the listings ones or are categorized as
dialects.
diff --git a/lib/lyx2lyx/lyx_2_6.py b/lib/lyx2lyx/lyx_2_6.py
index 1f69a66711..68969a9191 100644
--- a/lib/lyx2lyx/lyx_2_6.py
+++ b/lib/lyx2lyx/lyx_2_6.py
@@ -1525,6 +1525,49 @@ def revert_mintedlangs(document):
lps_res.append(l)
document.body[k] = "lstparams \"%s\"" % ",".join(lps_res)
+def revert_hex32colors(document):
+ """Revert 32bit ARGB hex colors to 16bit RGB"""
+ i = 0
+ while True:
+ i = find_token(document.header, "\\color", i + 1)
+ if i == -1:
+ break
+ cn = get_quoted_value(document.header, "\\color", i, i + 1)
+
+ hex32colors = []
+ hex16colors = []
+ hex32colors = cn.split()
+ for col in hex32colors:
+ if col.startswith("#"):
+ if len(col) == 9:
+ hex16colors.append("#" + col[3:])
+ elif len(col) == 7:
+ hex16colors.append(col)
+ else:
+ hex16colors.append(col)
+ document.header[i] = "\\color %s" % ' '.join(hex16colors)
+
+ i = 0
+ while True:
+ i = find_token(document.body, "\\color", i + 1)
+ if i == -1:
+ return
+ cn = get_quoted_value(document.body, "\\color", i, i + 1)
+
+ hex32colors = []
+ hex16colors = []
+ hex32colors = cn.split()
+ for col in hex32colors:
+ if col.startswith("#"):
+ if len(col) == 9:
+ hex16colors.append("#" + col[3:])
+ elif len(col) == 7:
+ hex16colors.append(col)
+ else:
+ hex16colors.append(col)
+ document.body[i] = "\\color %s" % ' '.join(hex16colors)
+
+
##
# Conversion hub
#
@@ -1541,11 +1584,13 @@ convert = [
[651, []],
[652, [convert_removed_numeric]],
[653, []],
- [654, []]
+ [654, []],
+ [655, []]
]
revert = [
+ [654, [revert_hex32colors]],
[653, [revert_mintedlangs]],
[652, [revert_specialfonts]],
[651, [revert_numeric]],
diff --git a/src/version.h b/src/version.h
index 8b648d0726..8a494df25b 100644
--- a/src/version.h
+++ b/src/version.h
@@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 654 // spitz: minted langs
-#define LYX_FORMAT_TEX2LYX 654
+#define LYX_FORMAT_LYX 655 // koji: ARGB colors
+#define LYX_FORMAT_TEX2LYX 655
#if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
#ifndef _MSC_VER
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs