Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Miscellaneous
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
practice problem folder
Miscellaneous
Commits
8d9a96e0
Commit
8d9a96e0
authored
3 weeks ago
by
Duncan Holmes
Browse files
Options
Downloads
Patches
Plain Diff
GOD IS COMING
parent
8aec8982
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
terminal_color_code_code
+60
-0
60 additions, 0 deletions
terminal_color_code_code
with
60 additions
and
0 deletions
terminal_color_code_code
0 → 100644
+
60
−
0
View file @
8d9a96e0
#colored terminal cood
print("\033[91mThis is red text\033[0m")
print("\033[92mThis is green text\033[0m")
print("\033[93mThis is yellow text\033[0m")
print("\033[94mThis is blue text\033[0m")
print("\033[95mThis is magenta text\033[0m")
print("\033[96mThis is cyan text\033[0m")
print("\033[1m\033[97mThis is bold white text\033[0m")
AKA
text color
RESET = "\033[0m" # Reset all attributes
# Regular Colors
BLACK = "\033[30m"
RED = "\033[31m"
GREEN = "\033[32m"
YELLOW = "\033[33m"
BLUE = "\033[34m"
MAGENTA = "\033[35m"
CYAN = "\033[36m"
WHITE = "\033[37m"
# Bright Colors
BRIGHT_BLACK = "\033[90m"
BRIGHT_RED = "\033[91m"
BRIGHT_GREEN = "\033[92m"
BRIGHT_YELLOW = "\033[93m"
BRIGHT_BLUE = "\033[94m"
BRIGHT_MAGENTA = "\033[95m"
BRIGHT_CYAN = "\033[96m"
BRIGHT_WHITE = "\033[97m"
background colors
# Regular Backgrounds
BG_BLACK = "\033[40m"
BG_RED = "\033[41m"
BG_GREEN = "\033[42m"
BG_YELLOW = "\033[43m"
BG_BLUE = "\033[44m"
BG_MAGENTA = "\033[45m"
BG_CYAN = "\033[46m"
BG_WHITE = "\033[47m"
# Bright Backgrounds
BG_BRIGHT_BLACK = "\033[100m"
BG_BRIGHT_RED = "\033[101m"
BG_BRIGHT_GREEN = "\033[102m"
BG_BRIGHT_YELLOW = "\033[103m"
BG_BRIGHT_BLUE = "\033[104m"
BG_BRIGHT_MAGENTA = "\033[105m"
BG_BRIGHT_CYAN = "\033[106m"
BG_BRIGHT_WHITE = "\033[107m"
example useage
print(f"{GREEN}Success!{RESET}")
print(f"{fg_color(208)}Orange-like color using 256-color mode{RESET}")
print(f"{BG_MAGENTA}{WHITE}Text with magenta background and white letters{RESET}")
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment