diff --git a/src/face_registry.cc b/src/face_registry.cc index 2079ada3..a1a0e582 100644 --- a/src/face_registry.cc +++ b/src/face_registry.cc @@ -14,9 +14,10 @@ static Face parse_face(StringView facedesc) if (bg_it != facedesc.end() and attr_it < bg_it) throw runtime_error("invalid face description, expected [,][+]"); Face res; - res.fg = str_to_color({facedesc.begin(), std::min(attr_it, bg_it)}); + res.fg = attr_it != facedesc.begin() ? + str_to_color({facedesc.begin(), std::min(attr_it, bg_it)}) : Color::Default; if (bg_it != facedesc.end()) - res.bg = str_to_color({bg_it+1, attr_it}); + res.bg = bg_it+1 != attr_it ? str_to_color({bg_it+1, attr_it}) : Color::Default; if (attr_it != facedesc.end()) { for (++attr_it; attr_it != facedesc.end(); ++attr_it)