Merge pull request #24 from nilclass/hex-color

Accept `#` prefix for colors
This commit is contained in:
Kevin Santo Cappuccio 2024-01-09 22:53:33 -08:00 committed by GitHub
commit 422369c850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);
}