--- src/config.cc +++ src/config.cc 2026-04-27 00:01:00.000000000 +0000 @@ -76,8 +76,9 @@ } int VerifyColorCb(cfg_t *cfg, cfg_opt_t *opt, const char *c_value, void *v_result) { - static_assert(std::numeric_limits::max() >= 0xFFFFFFFF, - "long should be 64 bits."); + // On 32-bit systems long is 32 bits and can't hold 0xFFFFFFFF as a positive value. + // Colors with high bit set will be stored as negative longs, + // but the bit pattern is preserved when cast back to uint32_t/SkColor. long *result = static_cast(v_result); string value{c_value}; @@ -89,14 +90,18 @@ return -1; } - long color = std::stol(value, nullptr, 16); + // Use unsigned long for parsing to handle full 32-bit color range, + // then cast to long for storage in libconfuse. + unsigned long ucolor = std::stoul(value, nullptr, 16); if (value.size() == 8) { // No alpha value. - *result = 0xFF000000 | color; + ucolor = 0xFF000000UL | ucolor; } else { // Skia stores the alpha value at top, but traditional RGBA stores it at the bottom. - *result = (color << 24) | (color >> 8); + ucolor = (ucolor << 24) | (ucolor >> 8); } + // Cast to long - on 32-bit this may be negative, but bit pattern is preserved + *result = static_cast(ucolor); return 0; }