Skip to content

Instantly share code, notes, and snippets.

@psiborg
Last active April 1, 2025 15:39
Show Gist options
  • Save psiborg/93a391ba9cb6b90c43be00ac67415f41 to your computer and use it in GitHub Desktop.
Save psiborg/93a391ba9cb6b90c43be00ac67415f41 to your computer and use it in GitHub Desktop.
Windows Terminal

Color Schemes

Ubuntu

Color RGB Item RGB
Black ${\textsf{\textcolor[rgb]{0.463, 0.463, 0.463}{■}}}$ #767676 Foreground ${\textsf{\textcolor[rgb]{1.000, 1.000, 1.000}{■}}}$ #FFFFFF
Red ${\textsf{\textcolor[rgb]{0.753, 0.110, 0.157}{■}}}$ #C01C28 Background ${\textsf{\textcolor[RGB]{48, 10, 36}{■}}}$ ${\textsf{\textcolor[rgb]{0.188, 0.039, 0.141}{■}}}$ #300A24
Green ${\textsf{\textcolor[rgb]{0.149, 0.635, 0.412}{■}}}$ #26A269 Cursor color ${\textsf{\textcolor[rgb]{1.000, 1.000, 1.000}{■}}}$ #FFFFFF
Yellow ${\textsf{\textcolor[rgb]{0.635, 0.451, 0.298}{■}}}$ #A2734C Selection background ${\textsf{\textcolor[rgb]{1.000, 1.000, 1.000}{■}}}$ #FFFFFF
Blue ${\textsf{\textcolor[rgb]{0.031, 0.271, 0.561}{■}}}$ #08458F
Purple ${\textsf{\textcolor[rgb]{0.639, 0.278, 0.729}{■}}}$ #A347BA
Cyan ${\textsf{\textcolor[rgb]{0.173, 0.624, 0.702}{■}}}$ #2C9FB3
White ${\textsf{\textcolor[rgb]{0.949, 0.949, 0.949}{■}}}$ #F2F2F2

Note: Colors are displayed using LaTeX format (e.g., ${\textsf{\color{lightgreen}Light Green}}$)

def hex_to_latex(hex_color, text="Color"):
# Ensure the hex code starts with '#'
if hex_color.startswith('#'):
hex_color = hex_color[1:]
# Convert hex to RGB (0-255)
r, g, b = tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4))
# Normalize to (0-1) range for LaTeX
r_norm, g_norm, b_norm = r / 255, g / 255, b / 255
# Format LaTeX command
latex_command = f"{{\\textsf{{\\textcolor[rgb]{{{r_norm:.3f}, {g_norm:.3f}, {b_norm:.3f}}}{{{text}}}}}}}"
return latex_command
# Example usage
hex_code = "#300A24"
print(hex_to_latex(hex_code, "■")) # Outputs: {\textsf{\textcolor[rgb]{0.188, 0.039, 0.141}{■}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment