feat(client): add support for 8-bit hex color codes in CSS

This allows users to use #RRGGBBAA format in their style.css.
The client now detects 8-bit hex codes, transforms them into
GTK-compatible rgba() syntax, and loads the modified data
into the CSS provider.

- Added utility to detect 8-bit hex patterns.
- Added transformation logic to convert hex alpha to decimal.
- Intercepted CSS loading in Client::setupCss to handle the conversion.
This commit is contained in:
Keepo
2026-03-28 21:10:15 -04:00
parent 49460defdc
commit 3b512d1a2c
5 changed files with 88 additions and 11 deletions

View File

@@ -0,0 +1,17 @@
#pragma once
#include <string>
/**
* Reads a CSS file, searches for 8-bit hex codes (#RRGGBBAA),
* and returns true if found, or false if not found.
*/
bool has_8bit_hex(std::string file_path);
/**
* Reads a CSS file, searches for 8-bit hex codes (#RRGGBBAA),
* and transforms them into GTK-compatible rgba() syntax.
*/
std::string transform_8bit_to_hex(std::string file_path);