support old <c hex> syntax too for backwards compatability

This commit is contained in:
HJfod 2024-07-29 22:05:37 +03:00
parent 7e87d675bc
commit 8de28d1e2a

View file

@ -82,6 +82,10 @@ Result<ccColor3B> colorForIdentifier(std::string const& tag) {
if (tag.length() > 2 && tag[1] == '-') {
return cc3bFromHexString(tag.substr(2));
}
// Support the old form of <carbitaryletters hex>
else if (tag.find(' ') != std::string::npos) {
return cc3bFromHexString(tag.substr(tag.find(' ') + 1));
}
else {
auto colorText = tag.substr(1);
if (!colorText.size()) {