git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit7983b99d4da146039a96b5ae931efa2d7ffde306
parent6866eba796
authorLucas Galante <[email protected]>
date2026-06-18 19:07
fix: make hex color parsing robust against extra quotes and spaces

 src/server/config.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/server/config.rs b/src/server/config.rs
index b3da516..378dcd0 100644
--- a/src/server/config.rs
+++ b/src/server/config.rs
@@ -382,7 +382,8 @@ pub struct TagLayoutConfig {
 }
 
 pub fn parse_hex_color(hex_str: &str) -> u32 {
-    let hex = hex_str.trim_start_matches('#');
+    let hex = hex_str.trim_matches(|c| c == '"' || c == '\'' || c == ' ');
+    let hex = hex.trim_start_matches('#');
     if hex.len() != 6 {
         return 0xFFFFFFFF; // fallback to white
     }