Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- color 0F
- mode 35,10
- :i
- cls
- echo **************************
- echo * Gerar cor aleatoria *
- echo **************************
- echo.
- echo.
- call :gerarC
- call :color "0%dC2%" "Texto de cor aleatoria..."
- echo.
- call :gerarC
- call :color "%corG%" "Texto e fundo de cor aleatoria."
- timeout 4 >nul
- goto i
- :gerarC
- set dC1=%RANDOM:~-1%
- set dC2=%RANDOM:~-1%
- set t1=%RANDOM:~-3,1%
- set t2=%RANDOM:~-3,1%
- if /i %t1% GTR 5 (
- if %t1%==4 set dC1=A
- if %t1%==5 set dC1=B
- if %t1%==6 set dC1=C
- if %t1%==7 set dC1=D
- if %t1%==8 set dC1=E
- if %t1%==9 set dC1=F
- )
- if /i %t2% GTR 5 (
- if %t2%==4 set dC2=A
- if %t2%==5 set dC2=B
- if %t2%==6 set dC2=C
- if %t2%==7 set dC2=D
- if %t2%==8 set dC2=E
- if %t2%==9 set dC2=F
- )
- set corG=%dC1%%dC2%
- goto :EOF
- :color
- echo >"%~2F"
- findstr /a:%1 /R "^" "%~2F*"
- del %2F
- goto :EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement