0 is alpha ff is opaque
This commit is contained in:
2023-12-11 14:28:04 +01:00
parent 6bc074a033
commit 1ec27e9ee3

View File

@@ -57,7 +57,6 @@ static char* shift_args(int* argc, char*** argv) {
static bool str_to_color(int argc, char** argv, uint32_t* color) {
if (argc == 1) {
*color = (uint32_t)strtoul(argv[0], NULL, 16);
*color ^= 0xff000000;
return false;
}
if (argc == 3) {
@@ -68,8 +67,7 @@ static bool str_to_color(int argc, char** argv, uint32_t* color) {
return false;
}
if (argc == 4) {
*color = 0xff000000;
*color ^= (uint32_t)strtoul(argv[0], NULL, 10) << 24;
*color = (uint32_t)strtoul(argv[0], NULL, 10) << 24;
*color |= (uint32_t)strtoul(argv[1], NULL, 10) << 16;
*color |= (uint32_t)strtoul(argv[2], NULL, 10) << 8;
*color |= (uint32_t)strtoul(argv[3], NULL, 10);