#!/usr/bin/env python3

import sys

def output(code,input):
    """
    param(input)[type=str]
    -------------
    - receive input

    param(code)[type=str]
    -----------
    - receive the code

    Reset
    -----
    - Reset Color_Off='0m'#Text Reset

    Regular Colors
    -------------- 
    - Black="0;30m"# Black
    - Red="0;31m"# Red
    - Green="0;32m"# Green
    - Yellow="0;33m"# Yellow
    - Blue="0;34m"# Blue
    - Purple="0;35m"# Purple
    - Cyan="0;36m"# Cyan
    - White="0;37m"# White

    Bold
    ----
    - BBlack="1;30m"# Black
    - BRed="1;31m"# Red
    - BGreen="1;32m"# Green
    - BYellow="1;33m"# Yellow
    - BBlue="1;34m"# Blue
    - BPurple="1;35m"# Purple
    - BCyan="1;36m"# Cyan
    - BWhite="1;37m"# White

    Underline
    ---------
    - UBlack="4;30m"# Black
    - URed="4;31m"# Red
    - UGreen="4;32m"# Green
    - UYellow="4;33m"# Yellow
    - UBlue="4;34m"# Blue
    - UPurple="4;35m"# Purple
    - UCyan="4;36m"# Cyan
    - UWhite="4;37m"# White

    Background
    ----------
    - On_Black="40m"# Black
    - On_Red="41m"# Red
    - On_Green="42m"# Green
    - On_Yellow="43m"# Yellow
    - On_Blue="44m"# Blue
    - On_Purple="45m"# Purple
    - On_Cyan="46m"# Cyan
    - On_White="47m"# White

    High Intensty
    -------------
    - IBlack="0;90m"# Black
    - IRed="0;91m"# Red
    - IGreen="0;92m"# Green
    - IYellow="0;93m"# Yellow
    - IBlue="0;94m"# Blue
    - IPurple="0;95m"# Purple
    - ICyan="0;96m"# Cyan
    - IWhite="0;97m"# White

    Bold High Intensty
    --------------------
    - BIBlack="1;90m"# Black
    - BIRed="1;91m"# Red
    - BIGreen="1;92m"# Green
    - BIYellow="1;93m"# Yellow
    - BIBlue="1;94m"# Blue
    - BIPurple="1;95m"# Purple
    - BICyan="1;96m"# Cyan
    - BIWhite="1;97m"# White

    High Intensty backgrounds
    -------------------------
    - On_IBlack="0;100m"# Black
    - On_IRed="0;101m"# Red
    - On_IGreen="0;102m"# Green
    - On_IYellow="0;103m"# Yellow
    - On_IBlue="0;104m"# Blue
    - On_IPurple="0;95m"# Purple
    - On_ICyan="0;106m"# Cyan
    - On_IWhite="0;107m"# White
    
    """
    try:
        data = f"\033[{code}{input}\033[m"+"\n"
        if len(sys.argv) > 1:
            data = f"\033[{sys.argv[1]}{sys.argv[2]}\033[m"+"\n"
        return sys.stdout.write(data)
    except TypeError as err:
        return None

