Skip to content

Commit 4307a20

Browse files
committed
Simplified fg's and bg's get_value()
1 parent b8633ef commit 4307a20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd2/ansi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def colors() -> List[str]:
6262
@staticmethod
6363
def get_value(name: str) -> str:
6464
"""Retrieve color code by name string."""
65-
return fg.__members__[name].value
65+
return fg[name].value
6666

6767

6868
# Background colors
@@ -100,7 +100,7 @@ def colors() -> List[str]:
100100
@staticmethod
101101
def get_value(name: str) -> str:
102102
"""Retrieve color code by name string."""
103-
return bg.__members__[name].value
103+
return bg[name].value
104104

105105

106106
FG_RESET = fg.reset.value

0 commit comments

Comments
 (0)