Description: |
call:getRandomColor ret |
Script: |
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.
|
:getRandomColor ret -- returns a random color
:: -- ret [out,opt] - return variable to return color code in
:$created 20060101 :$changed 20080219 :$categories Color
:$source https://www.dostips.com
SETLOCAL
set HEX=0123456789ABCDEF
set /a r1=%random% %% 16
set /a r2=%random% %% 16
call set rndcolor=%%HEX:~%r1%,1%%%%HEX:~%r2%,1%%
ENDLOCAL & IF "%~1" NEQ "" (SET %~1=%rndcolor%) ELSE (echo.%rndcolor%)
EXIT /b
|
|