Skip to content

Commit

Permalink
improve AnsiStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
zoumingzhe committed Apr 1, 2024
1 parent 1368087 commit 1ad1588
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
15 changes: 11 additions & 4 deletions colorama/ansi.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,17 @@ class AnsiBack(AnsiCodes):


class AnsiStyle(AnsiCodes):
BRIGHT = 1
DIM = 2
NORMAL = 22
RESET_ALL = 0
BRIGHT = 1
DIM = 2
ITALIC = 3
UNDERLINE = 4
SLOWBLINK = 5
RAPIDBLINK = 6
INVERT = 7
HIDE = 8
STRIKETHROUGH = 9
NORMAL = 22
RESET_ALL = 0

Fore = AnsiFore()
Back = AnsiBack()
Expand Down
7 changes: 7 additions & 0 deletions colorama/tests/ansi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ def testBackAttributes(self):

def testStyleAttributes(self):
self.assertEqual(Style.DIM, '\033[2m')
self.assertEqual(Style.ITALIC, '\033[3m')
self.assertEqual(Style.UNDERLINE, '\033[4m')
self.assertEqual(Style.SLOWBLINK, '\033[5m')
self.assertEqual(Style.RAPIDBLINK, '\033[6m')
self.assertEqual(Style.INVERT, '\033[7m')
self.assertEqual(Style.HIDE, '\033[8m')
self.assertEqual(Style.STRIKETHROUGH, '\033[9m')
self.assertEqual(Style.NORMAL, '\033[22m')
self.assertEqual(Style.BRIGHT, '\033[1m')

Expand Down

0 comments on commit 1ad1588

Please sign in to comment.