diff --git a/modules/ui_symbols.py b/modules/ui_symbols.py index d60aabe47..ddc16c273 100644 --- a/modules/ui_symbols.py +++ b/modules/ui_symbols.py @@ -40,3 +40,24 @@ sort_time_asc = '\uf0de' sort_time_dsc = '\uf0dd' style_apply = '↶' style_save = '↷' + +class SVGSymbol: + def __init__(self, svg: str): + self.svg = svg + self.before = "" + self.after = "" + self.supports_color = False + if "currentColor" in self.svg: + self.supports_color = True + self.before, self.after = self.svg.split("currentColor", maxsplit=1) + + def color(self, color: str): + if self.supports_color: + return self.before + color + self.after + else: + return self.svg + + def __str__(self): + return self.svg + +svg_bullet = SVGSymbol("")