批处理文件混合多种颜色 [英] Batch file Mixing multiple colors
问题描述
我一直在想,如果有人做出一个批处理文件,实用工具,可以混批2
颜色成另一种颜色(例如:红+黄,使橙色)。我真的不知道,如果它甚至有可能还是不要做这样的事情,但如果有,我想知道。
I've been wondering if someone have made a batch file utility that can mix 2 batch colors into another color (for example: Red + Yellow to make Orange). I don't really know if its even possible or not to do such a thing, but if there is, I want to know.
推荐答案
好吧,如果以批色你指的颜色
命令的颜色值,那么它是很容易根据所表现出原有的颜色表得到一些等价彩色/
命令:
Well, if with "batch colors" you refer to color values of color
command, then it is very easy to get some equivalences based on the original color table shown by color /?
command:
0 = Black 8 = Gray
1 = Blue 9 = Light blue
2 = Green A = Light green
3 = Aqua B = Light aqua
4 = Red C = Light red
5 = Magenta D = Light magenta
6 = Brown E = Yellow
7 = White F = Bright white
(也许是颜色名称是不一样的颜色/?
命令,我从我的西班牙语Windows翻译他们)
(perhaps color names are not the same of color /?
command, I am translating they from my Spanish Windows)
这个方式,我们可能会看到红+黄(4 + E = 12模F = 2)给出了绿色!
This way, we may see that Red+Yellow (4+E = 12 mod F = 2) gives Green!
@echo off
setlocal EnableDelayedExpansion
set hexa=0123456789ABCDEF
set /P "first=Enter first color (hexa digit): "
set /P "second=Enter second color (hexa digit): "
set /A sum= (0x%first% + 0x%second%) %% 16
set result=!hexa:~%sum%,1!
color %result%
echo The result is: %result%
这篇关于批处理文件混合多种颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!