Coding style

- Use staticmethod where possible.
This commit is contained in:
Andrew Hamilton 2022-05-28 22:44:37 +10:00
parent d5ab419fc2
commit 0ab831e48b
3 changed files with 6 additions and 3 deletions

View file

@ -127,7 +127,8 @@ class CharStyle:
attributes.append("u")
return f"<CharStyle: fg:{self.fg_color} bg:{self.bg_color} attr:{','.join(attributes)}>"
def _color_code(self, color_, is_foreground):
@staticmethod
def _color_code(color_, is_foreground):
if isinstance(color_, int):
return color(color_, is_foreground)
else: # true color