Accept # prefix for colors

This commit is contained in:
Niklas Cathor 2024-01-10 07:48:07 +01:00
parent f4dc793289
commit 1ae05b08e3

View File

@ -351,6 +351,10 @@ int removeHexPrefix(const char *str)
const char *hexValue = str + 2;
return strtol(hexValue, nullptr, 16);
}
if (str[0] == '#') {
const char *hexValue = str + 1;
return strtol(hexValue, nullptr, 16);
}
return atoi(str);
}