Skip to content

Constants#

start = "\x1b["
end = reset = "\x1b[0m"

Foreground Colors#

  • black
  • dark_grey

  • red

  • bright_red

  • green

  • bright_green

  • orange

  • yellow

  • blue

  • bright_blue

  • purple

  • pink

  • cyan

  • bright_cyan

  • grey

  • white

BackGround Colors#

  • bg_black
  • bg_dark_grey

  • bg_red

  • bg_bright_red

  • bg_green

  • bg_bright_green

  • bg_orange

  • bg_yellow

  • bg_blue

  • bg_bright_blue

  • bg_purple

  • bg_pink

  • bg_cyan

  • bg_bright_cyan

  • bg_grey

  • bg_white

Font Styles#

  • default
  • bold
  • dim
  • italic
  • underline
  • blink
  • rapid_blink
  • inverse
  • hidden
  • strike_through
  • framed
  • encircled
  • overlined

RGB colors support#

hexBgColor #

hexBgColor(color)

hex color code decorator

Parameters:

Name Type Description Default
color str | int

hex color code

required

Returns:

Name Type Description
color str

colored string

Raises:

Type Description
ValueError

if the hex color code is invalid

hexColor #

hexColor(color)

hex color code decorator

Parameters:

Name Type Description Default
color str | int

hex color code

required

Returns:

Name Type Description
color str

colored string

Raises:

Type Description
ValueError

if the hex color code is invalid

rgbBgColor #

rgbBgColor(_red, _green, _blue)

RGB background color decorator

Parameters:

Name Type Description Default
_red int

ranges from 0 to 255

required
_green int

ranges from 0 to 255

required
_blue int

ranges from 0 to 255

required

Returns:

Name Type Description
color str

colored string

Raises:

Type Description
ValueError

if the rgb color code is invalid

rgbColor #

rgbColor(_red, _green, _blue)

RGB color decorator

Parameters:

Name Type Description Default
_red int

ranges from 0 to 255

required
_green int

ranges from 0 to 255

required
_blue int

ranges from 0 to 255

required

Returns:

Name Type Description
color str

colored string

Raises:

Type Description
ValueError

if the rgb color code is invalid