This commit is contained in:
un1xx committed 2024-03-08 23:17:48 +05:30
1 parent 947e0161a3
commit b71e17086d
9 files changed
+553 -2

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
# ansi code blocks for pretty text
class AnsiBlocks:
gray = "\u001b[0;30m{}\u001b[0;0m"
red = "\u001b[0;31m{}\u001b[0;0m"
green = "\u001b[0;32m{}\u001b[0;0m"
yellow = "\u001b[0;33m{}\u001b[0;0m"
blue = "\u001b[0;34m{}\u001b[0;0m"
pink = "\u001b[0;35m{}\u001b[0;0m"
cyan = "\u001b[0;36m{}\u001b[0;0m"
white = "\u001b[0;37m{}\u001b[0;0m"
def wrap(self, color: str, text: str, bold: bool = False):
if bold:
color.replace("[0", "[1")
return "```ansi\n" + color.format(text) + "\n```"