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:
17
include/util/hex_checker.hpp
Normal file
17
include/util/hex_checker.hpp
Normal 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);
|
||||
Reference in New Issue
Block a user