fix: removed unnecessary function, update header file for signature change.

This commit is contained in:
Keepo
2026-03-28 23:02:16 -04:00
parent 937ef176ff
commit 3533265675
2 changed files with 1 additions and 23 deletions

View File

@@ -2,16 +2,9 @@
#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);
std::string transform_8bit_to_hex(const std::string& file_path);

View File

@@ -1,15 +0,0 @@
#include <filesystem>
#include <fstream>
#include <regex>
namespace fs = std::filesystem;
bool has_8bit_hex(std::string file_path) {
std::ifstream f(file_path, std::ios::in | std::ios::binary);
const auto size = fs::file_size(file_path);
std::string result(size, '\0');
f.read(result.data(), size);
std::regex pattern(
R"((?:\#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})))");
return std::regex_search(result, pattern);
}