def by_hex(fg, bg = "#000000", attribute = 0):
    """
    Return string with ANSI escape code for set text colors 

    fg: html hex code for text color
    bg: html hex code for background color
    attribute: use Attribute class variables
    """
    # Delete #
    fg = fg.replace("#", "")
    bg = bg.replace("#", "")

    fg_r = int(fg[0:2], 16)
    fg_g = int(fg[2:4], 16)
    fg_b = int(fg[4:6], 16)
    fg_rgb = f"{fg_r};{fg_g};{fg_b}"

    bg_r = int(bg[0:2], 16)
    bg_g = int(bg[2:4], 16)
    bg_b = int(bg[4:6], 16)
    bg_rgb = f"{bg_r};{bg_g};{bg_b}"

    return f"\033[{attribute};38;2;{fg_rgb};48;2;{bg_rgb}m"