added @ operator shortcut for MKWColor to color a text

This commit is contained in:
Faraphel 2022-08-20 18:11:45 +02:00
parent 92f32aec80
commit 32efccbd60

View file

@ -42,6 +42,9 @@ class MKWColor:
"""
return f'{self.raw}{text}{get(bmg="off").raw}'
def __matmul__(self, other: str) -> str: # the operator @. Example : MKWColor.get(bmg="white") @ "text_to_color"
return self.color_text(other)
all_colors: list[MKWColor] = [
MKWColor(bmg="white", hexadecimal=0xFFFFFF, name="white"),