from matplotlib import pyplot as plt
from matplotlib.colors import LinearSegmentedColormap

RED = "\033[38;5;196m"
RED_L = "\033[38;5;1m"
YEL = "\033[38;5;226m"
YEL_L = "\033[38;5;11m"
GRE = "\033[38;5;76m"
GRE_L = "\033[38;5;2m"
BLU_L = "\033[94m"
PUR = "\033[95m"
ORA = "\033[38;5;208m"
ORA_L = "\033[38;5;9m"
RES = "\033[0m"

def print_color_codes():
    for code in range(0, 356):
        print(f"\033[38;5;{code}m{code:3}\033[0m", end=" ")

def plt_title_styled(title, ax=None, y=1.1):
    if ax is not None:
        ax.set_title(f"\n{title}", fontsize=TITLE_FONTSIZE, fontweight="bold", y=y)
    else:
        plt.title(f"\n{title}", fontsize=TITLE_FONTSIZE, fontweight="bold", y=y)

PLOT_COLORS = ['#7E57C2', 'red', 'black', '#1f77b4']
CMAP = LinearSegmentedColormap.from_list("custom_lila", ["#FFFFFF", PLOT_COLORS[0]])
CMAPS = ['Blues', 'autumn', 'bone_r', 'coolwarm', 'Pastel1', 'Pastel1_r', 'Set2']

PLOT_TITLE_FONTSIZE = 14
TITLE_FONTSIZE = 24