mirror of
https://github.com/kennethreitz/replit-py.git
synced 2026-06-05 15:00:20 +00:00
formatting
This commit is contained in:
+16
-11
@@ -1,9 +1,12 @@
|
||||
"""Pure Python ANSI Color Escape Code generator."""
|
||||
|
||||
|
||||
import colorsys
|
||||
|
||||
|
||||
def clear() -> None:
|
||||
"""Clear the terminal."""
|
||||
|
||||
print("\033[H\033[2J", end="", flush=True)
|
||||
|
||||
|
||||
@@ -41,7 +44,7 @@ class Color:
|
||||
|
||||
Args:
|
||||
hexvalue (str): The color's hex value
|
||||
|
||||
|
||||
Raises:
|
||||
ValueError
|
||||
|
||||
@@ -65,7 +68,7 @@ class Color:
|
||||
|
||||
Args:
|
||||
hexvalue (str): The color's hex value
|
||||
|
||||
|
||||
Raises:
|
||||
ValueError
|
||||
|
||||
@@ -87,7 +90,7 @@ class Color:
|
||||
|
||||
Args:
|
||||
hexvalue (str): The color's hex value
|
||||
|
||||
|
||||
Raises:
|
||||
ValueError
|
||||
|
||||
@@ -124,14 +127,16 @@ class Bit:
|
||||
self.bg = f"\033[48;5;{value}m"
|
||||
|
||||
|
||||
attributes = { # use only repl.it supported ansi codes. Codes such as blink do not work.
|
||||
"reset": 0,
|
||||
"bold": 1,
|
||||
"faint": 2,
|
||||
"italic": 3,
|
||||
"underline": 4,
|
||||
"highlight": 7,
|
||||
}
|
||||
attributes = (
|
||||
{ # use only repl.it supported ansi codes. Codes such as blink do not work.
|
||||
"reset": 0,
|
||||
"bold": 1,
|
||||
"faint": 2,
|
||||
"italic": 3,
|
||||
"underline": 4,
|
||||
"highlight": 7,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class Attr:
|
||||
|
||||
Reference in New Issue
Block a user