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]{118, 118, 118}{■}}}$ #767676 Foreground ${\textsf{\textcolor[RGB]{255, 255, 255}{■}}}$ #FFFFFF
Red ${\textsf{\textcolor[RGB]{192, 28, 40}{■}}}$ #C01C28 Background ${\textsf{\textcolor[RGB]{48, 10, 36}{■}}}$ #300A24
Green ${\textsf{\textcolor[RGB]{38, 162, 105}{■}}}$ #26A269 Cursor color ${\textsf{\textcolor[RGB]{255, 255, 255}{■}}}$ #FFFFFF
Yellow ${\textsf{\textcolor[RGB]{162, 115, 76}{■}}}$ #A2734C Selection background ${\textsf{\textcolor[RGB]{255, 255, 255}{■}}}$ #FFFFFF
Blue ${\textsf{\textcolor[RGB]{8, 69, 143}{■}}}$ #08458F
Purple ${\textsf{\textcolor[RGB]{163, 71, 186}{■}}}$ #A347BA
Cyan ${\textsf{\textcolor[RGB]{44, 159, 179}{■}}}$ #2C9FB3
White ${\textsf{\textcolor[RGB]{242, 242, 242}{■}}}$ #F2F2F2

Note: Colors are displayed using LaTeX format

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}{■}}}
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))
# Format LaTeX command with RGB (0-255)
latex_command = f"{{\\textsf{{\\textcolor[RGB]{{{r}, {g}, {b}}}{{{text}}}}}}}"
return latex_command
# Example usage
hex_code = "#300A24"
print(hex_to_latex(hex_code, "■")) # Output: {\textsf{\textcolor[RGB]{48, 10, 36}{■}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment