Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Echo off & Goto :Main
- REM For windows 10, there's a much simpler option for color handling when displaying text with a variety of colors on the same screen.
- ECHO [31m black background red text
- ECHO [32m black background green text
- ECHO [33m black background yellow text
- ECHO [34m black background dark blue text
- ECHO [35m black background purple text
- ECHO [36m black background light blue text
- ECHO [37m black background white text
- ECHO [90m black background grey text
- ECHO [7m invert background and text color (requires [0m to revert to non inverted colors)
- ECHO [4m underline text (requires [0m to disable underlining)
- ECHO [1m lighten the text color (requires [0m to revert to normal color intensity)
- REM Other Ansi options include Cursor positioning to change what line and column text is echoed at
- ECHO [1;1H ([Line;ColumnH)
- REM and clear all text from line / column position (for that line only)
- ECHO [1;1H [K (Text can be printed on this line, starting at the coordinates specified)
- REM Color options can be combined, and changed at any point on a line, multiple times:
- ECHO [33m[7m (will invert to yellow background with black text)
- REM (until [0m is used to reset to default)
- ECHO [1m[33m[7m (will invert to light yellow background with black text)
- REM (until [0m is used to reset to default)
- ECHO [31mR[33mO[1m[33mY[0m[32mG[36mB[1m[35mI[0m[35mV
- REM red R dark yellow O light yellow Y green G lightblue B light purple I dark purple V
- REM Colors will persist until you use another ansi color code to change color or restore default.
- REM Using CMD's Color XX will cause text / background to display as they normally would with the color / Background color selected
- REM until another Ansi Color Code is used.
- REM Adoption of the Ansi color system in windows 10 opens up some interesting possibilites for ansi Art and animation (particularly
- REM with the cursor positioning allowing more refined control over what text gets displayed where, without affecting other lines).
- *** Example of using codes within Variables***
- :main
- Set "Red=[0m[31m"
- Set "Pink=[0m[1m[31m"
- Set "Green=[0m[32m"
- Set "Light_Green=[0m[1m[32m"
- Set "Yellow=[0m[33m"
- Set "Light_Yellow=[0m[1m[33m"
- Set "Blue=[0m[34m"
- Set "Light_Blue=[0m[1m[34m"
- Set "Purple=[0m[35m"
- Set "Magenta=[0m[1m[35m"
- Set "Cyan=[0m[36m"
- Set "White=[0m[34m"
- Set "Grey=[0m[90m"
- Echo(%blue%This is a Blue example, %Pink%Now Pink. %Green%Here's some Green.
- Pause
Advertisement
Add Comment
Please, Sign In to add comment