Skip to content

Commit

Permalink
Documentation updates; added misssing GREY aliases in AnsiFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
James Smith authored and James Smith committed Nov 28, 2024
1 parent c1c79db commit ae05b78
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/ansi_string/ansi_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,13 @@ class AnsiFormat(Enum):
FG_GRAY=_AnsiControlFn.fg_color256(244)
FG_GREY=FG_GRAY # Alias for my British English friends
FG_DIM_GRAY=_AnsiControlFn.fg_rgb(105, 105, 105)
FG_DIM_GREY=FG_DIM_GRAY
FG_LIGHT_SLATE_GRAY=_AnsiControlFn.fg_rgb(119, 136, 153)
FG_LIGHT_SLATE_GREY=FG_LIGHT_SLATE_GRAY
FG_SLATE_GRAY=_AnsiControlFn.fg_rgb(112, 128, 144)
FG_SLATE_GREY=FG_SLATE_GRAY
FG_DARK_SLATE_GRAY=_AnsiControlFn.fg_rgb(47, 79, 79)
FG_DARK_SLATE_GREY=FG_DARK_SLATE_GRAY

# Alias FG_XXX to XXX
INDIAN_RED=FG_INDIAN_RED
Expand Down Expand Up @@ -860,9 +864,13 @@ class AnsiFormat(Enum):
BG_GRAY=_AnsiControlFn.bg_color256(244)
BG_GREY=BG_GRAY # Alias for my British English friends
BG_DIM_GRAY=_AnsiControlFn.bg_rgb(105, 105, 105)
BG_DIM_GREY=BG_DIM_GRAY
BG_LIGHT_SLATE_GRAY=_AnsiControlFn.bg_rgb(119, 136, 153)
BG_LIGHT_SLATE_GREY=BG_LIGHT_SLATE_GRAY
BG_SLATE_GRAY=_AnsiControlFn.bg_rgb(112, 128, 144)
BG_SLATE_GREY=BG_SLATE_GRAY
BG_DARK_SLATE_GRAY=_AnsiControlFn.bg_rgb(47, 79, 79)
BG_DARK_SLATE_GREY=BG_DARK_SLATE_GRAY

# Enable underline and set to color
UL_BLACK=_AnsiControlFn.ul_color256(0)
Expand Down Expand Up @@ -1006,9 +1014,13 @@ class AnsiFormat(Enum):
UL_GRAY=_AnsiControlFn.ul_color256(244)
UL_GREY=UL_GRAY # Alias for my British English friends
UL_DIM_GRAY=_AnsiControlFn.ul_rgb(105, 105, 105)
UL_DIM_GREY=UL_DIM_GRAY
UL_LIGHT_SLATE_GRAY=_AnsiControlFn.ul_rgb(119, 136, 153)
UL_LIGHT_SLATE_GREY=UL_LIGHT_SLATE_GRAY
UL_SLATE_GRAY=_AnsiControlFn.ul_rgb(112, 128, 144)
UL_SLATE_GREY=UL_SLATE_GRAY
UL_DARK_SLATE_GRAY=_AnsiControlFn.ul_rgb(47, 79, 79)
UL_DARK_SLATE_GREY=UL_DARK_SLATE_GRAY

# Enable double underline and set to color
DUL_BLACK=_AnsiControlFn.dul_color256(0)
Expand Down Expand Up @@ -1152,9 +1164,13 @@ class AnsiFormat(Enum):
DUL_GRAY=_AnsiControlFn.dul_color256(244)
DUL_GREY=DUL_GRAY # Alias for my British English friends
DUL_DIM_GRAY=_AnsiControlFn.dul_rgb(105, 105, 105)
DUL_DIM_GREY=DUL_DIM_GRAY
DUL_LIGHT_SLATE_GRAY=_AnsiControlFn.dul_rgb(119, 136, 153)
DUL_LIGHT_SLATE_GREY=DUL_LIGHT_SLATE_GRAY
DUL_SLATE_GRAY=_AnsiControlFn.dul_rgb(112, 128, 144)
DUL_SLATE_GREY=DUL_SLATE_GRAY
DUL_DARK_SLATE_GRAY=_AnsiControlFn.dul_rgb(47, 79, 79)
DUL_DARK_SLATE_GREY=DUL_DARK_SLATE_GRAY

def __init__(self, seq:Union[int, AnsiSetting, List[Union[int, AnsiSetting]]]):
'''
Expand Down Expand Up @@ -1185,6 +1201,7 @@ def __init__(self, seq:Union[int, AnsiSetting, List[Union[int, AnsiSetting]]]):

@property
def ansi_settings(self) -> Tuple[AnsiSetting]:
''' Tuple of ANSI settings which, together, applies the AnsiFormat type '''
return self._ansi_settings

@staticmethod
Expand Down
4 changes: 4 additions & 0 deletions src/ansi_string/ansi_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class AnsiParamEffect(Enum):
UL_COLOUR=UL_COLOR

class AnsiParamEffectFn(Enum):
''' Enumerates the function of the AnsiParamEffect '''
RESET_ALL=enum_auto()
APPLY_SETTING=enum_auto()
CLEAR_SETTING=enum_auto()
Expand Down Expand Up @@ -233,14 +234,17 @@ def __init__(self, code):

@property
def code(self) -> int:
''' The ANSI code which activates the AnsiParam type '''
return self._code

@property
def effect_type(self) -> AnsiParamEffect:
''' The type of effect group that this AnsiParam sets or clears '''
return self._effect_type

@property
def effect_fn(self) -> AnsiParamEffectFn:
''' The function of the effect_type '''
return self._effect_fn


Expand Down

0 comments on commit ae05b78

Please sign in to comment.