re slore
哦,那就是
12 红
34 绿
56 蓝
着三个分段+和-吧??通过调节三段来控制是吗?》
哦,那就是
12 红
34 绿
56 蓝
着三个分段+和-吧??通过调节三段来控制是吗?》
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
Originally posted by slore at 2007-3-11 06:58:
貌似只有2个颜色的过渡?
@echo off
setlocal EnableDelayedExpansion
set Num=1
for /l %%i in (1,1,6) do (
if !Num! LEQ 16 for %%n in (0 1 2 3 4 5 6 7 8 9 a b c d e f) do set color!Num!=ff%%n%%n00&set /a Num+=1
if !Num! GTR 16 if !Num! LEQ 31 for %%n in (e d c b a 9 8 7 6 5 4 3 2 1 0) do set color!Num!=%%n%%n!color16:~-4!&set /a Num+=1
if !Num! GTR 31 if !Num! LEQ 46 for %%n in (1 2 3 4 5 6 7 8 9 a b c d e f) do set color!Num!=!color31:~0,4!%%n%%n&set /a Num+=1
if !Num! GTR 46 if !Num! LEQ 61 for %%n in (e d c b a 9 8 7 6 5 4 3 2 1 0) do set color!Num!=!color46:~0,2!%%n%%n!color46:~-2!&set /a Num+=1
if !Num! GTR 61 if !Num! LEQ 76 for %%n in (1 2 3 4 5 6 7 8 9 a b c d e f) do set color!Num!=%%n%%n!color61:~-4!&set /a Num+=1
if !Num! GTR 76 if !Num! LEQ 90 for %%n in (e d c b a 9 8 7 6 5 4 3 2 1) do set color!Num!=!color76:~0,4!%%n%%n&set /a Num+=1
)
:Main
cls
echo.
set Num=
set input=
set /p Num= 输入开始颜色(红绿蓝):
for %%n in (R G B) do if /i "%Num%" == "%%n" goto input
goto Main
:input
set /p input= 输入文字:
if not defined input exit
if /i "%Num%" == "R" set Num=0
if /i "%Num%" == "G" set Num=30
if /i "%Num%" == "B" set Num=60
cd.>test.txt
:loop
set /a Num+=1
>>test.txt set /p=%input:~0,1%<nul
set "input=%input:~1%"
if %num% GEQ 90 set Num=
if not "%input%" == "" goto loop
start test.txt
goto Main
exit::zh159@bbs.cn-dos.net
@echo off
setlocal EnableDelayedExpansion
set Num=1
for /l %%i in (1,1,6) do (
if !Num! LEQ 16 for %%n in (0 1 2 3 4 5 6 7 8 9 a b c d e f) do set color!Num!=ff%%n%%n00&set /a Num+=1
if !Num! GTR 16 if !Num! LEQ 31 for %%n in (e d c b a 9 8 7 6 5 4 3 2 1 0) do set color!Num!=%%n%%n!color16:~-4!&set /a Num+=1
if !Num! GTR 31 if !Num! LEQ 46 for %%n in (1 2 3 4 5 6 7 8 9 a b c d e f) do set color!Num!=!color31:~0,4!%%n%%n&set /a Num+=1
if !Num! GTR 46 if !Num! LEQ 61 for %%n in (e d c b a 9 8 7 6 5 4 3 2 1 0) do set color!Num!=!color46:~0,2!%%n%%n!color46:~-2!&set /a Num+=1
if !Num! GTR 61 if !Num! LEQ 76 for %%n in (1 2 3 4 5 6 7 8 9 a b c d e f) do set color!Num!=%%n%%n!color61:~-4!&set /a Num+=1
if !Num! GTR 76 if !Num! LEQ 90 for %%n in (e d c b a 9 8 7 6 5 4 3 2 1) do set color!Num!=!color76:~0,4!%%n%%n&set /a Num+=1
)
:Main
cls
echo.
set RGB=
set /p RGB= 输入开始颜色(红橙黄绿青蓝紫):
for /l %%n in (1,1,7) do if "%RGB%" == "%%n" goto input
echo.
echo 输入开始颜色错误!
echo.
pause
goto Main
:input
set Num=
for %%n in (1 8 16 31 46 61 76) do set /a Num+=1&if "%RGB%" == "!Num!" set RGB=%%n
echo.
set input=
set /p input= 输入文字:
if not defined input exit
set Num=
set "str=%input%"
:Num
set "str=%str:~1%"
set /a Num+=1
if not "%str%" == "" goto Num
set step=1
for %%n in (70 40 20 10) do if %Num% lss %%n set /a step+=1
cd.>test.txt
:loop
>>test.txt set /p=%input:~0,1%<nul
set /a RGB+=%step%
set "input=%input:~1%"
if %RGB% GTR 90 set RGB=1
if not "%input%" == "" goto loop
start test.txt
goto Main
exit