mirror of
https://github.com/Architeuthis-Flux/Jumperless.git
synced 2025-02-21 04:47:29 +01:00
Merge pull request #24 from nilclass/hex-color
Accept `#` prefix for colors
This commit is contained in:
commit
422369c850
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user