def escape_color(hexa: str = "", r: int = 0, g: int = 0, b: int = 0, depth: str = "fg") -> str:
		"""Returns escape sequence to set color
		* accepts either 6 digit hexadecimal hexa="#RRGGBB", 2 digit hexadecimal: hexa="#FF"
		* or decimal RGB: r=0-255, g=0-255, b=0-255
		* depth="fg" or "bg"
		"""
		dint: int = 38 if depth == "fg" else 48
		color: str = ""
		if hexa:
			try:
				if len(hexa) == 3:
					c = int(hexa[1:], base=16)
					if CONFIG.truecolor and not LOW_COLOR:
						color = f'\033[{dint};2;{c};{c};{c}m'
					else:
						color = f'{Color.truecolor_to_256(rgb=(c, c, c), depth=depth)}'
				elif len(hexa) == 7:
					if CONFIG.truecolor and not LOW_COLOR:
						color = f'\033[{dint};2;{int(hexa[1:3], base=16)};{int(hexa[3:5], base=16)};{int(hexa[5:7], base=16)}m'
					else:
						color = f'{Color.truecolor_to_256(rgb=(int(hexa[1:3], base=16), int(hexa[3:5], base=16), int(hexa[5:7], base=16)), depth=depth)}'
			except ValueError as e:
				errlog.exception(f'{e}')
		else:
			if CONFIG.truecolor and not LOW_COLOR:
				color = f'\033[{dint};2;{r};{g};{b}m'
			else:
				color = f'{Color.truecolor_to_256(rgb=(r, g, b), depth=depth)}'
		return color
Returns escape sequence to set color
		* accepts either 6 digit hexadecimal hexa="#RRGGBB", 2 digit hexadecimal: hexa="#FF"
		* or decimal RGB: r=0-255, g=0-255, b=0-255
		* depth="fg" or "bg"
		
bpytop.py