About Ascii Interchange(American Standard Code for Information Interchange)
About Ascii Interchange
the core char : “\033[#m”, "#"represent: the style of the text or the background. such as 2 is dim, 5 and 6 are flashing, 8 is invisible text, 21 is double underlined, 30 is black text, 37 is white text, 40 is black background, and 53 is an upward line. You can check all the styles by the command:
1 | |
It’s from https://blog.csdn.net/Blaze_dL/article/details/142767515 you can find the original author’s codes.
And you can also add the color by adding some ‘;’ after the first style number. and the first one: only has two options–2 and 5, use 5 and the second number to show the fixed color, use 2;R;G;B to show nearly all the color we’ve ever seen, and the second one is from 0 to 256, you can also check the colors by the codes:
1 | |
You might wonder why 38 and 48 are used here, as they don’t seem to make a difference in font style, well, but it definitely represents the front color and the background color.
Finally as I also mentioned before, you can use 38 or 48 ‘;’ 2 ‘;’ and add RGB after ‘;’ to show the rgb color. And I’ll put the Image so I can find the style and the color conveniently.
Style and the fixed color
style:

fixed color:
