繁体   English   中英

什么是“有效的IM颜色”?

[英]What is a “valid IM color”?

我在bash脚本中找到了以下文档,这些脚本是为一些名为“ imagemagick ”的软件编写的。

# USAGE: multicrop2 [-c coords] [-b bcolor] [more options, blah blah,...]
# [... snip ...]
# -b     bcolor        background color to use instead of option -c;
#                      any valid IM color; default is to use option -c

我无法理解代码作者认为的“有效IM颜色”。 我猜“IM”只是“图像”的缩写,但也许是“即时通讯”,或其他意思。 你怎么看?

RGB的十六进制代码在低位字节中为蓝色,在中间字节中为绿色,在高位字节中为红色,但我不确定它们是否对颜色使用标准RGB编码。

Multicrop2是我的脚本。 有效的ImageMagick颜色是ImageMagick识别的任何颜色方案,例如rgb,hex,cmyk,hsl,甚至是其文档中指定格式的颜色名称,尤其是http://www.imagemagick.org/script/color。 PHP 在我的脚本中列出的内容太多了。 我经常提到这个链接,但显然在这种情况下我没有。 但大多数ImageMagick用户都知道它的典型配色方案。 ImageMagick用户大多知道IM是ImageMagick的缩写。 颜色大部分遵循CSS stye指南。 带#,空格或括号的颜色需要引用,至少在类Unix系统上。 颜色名称不需要引用。 向我的脚本和ImageMagick的新手道歉。

例子:

rgb(255, 0, 0)                          range 0 - 255
rgba(255, 0, 0, 1.0)                    the same, with an explicit alpha value
rgb(100%, 0%, 0%)                       range 0.0% - 100.0%
rgba(100%, 0%, 0%, 1.0)                 the same, with an explicit alpha value
#ff0000                                 #rrggbb
#ff0000ff                               #rrggbbaa
gray50                                  near mid gray
gray(127)                               near mid gray
gray(50%)                               mid gray
graya(50%, 0.5)                         semi-transparent mid gray
hsb(120, 100%,  100%)                   full green in hsb
hsba(120, 100%,  100%,  1.0)            the same, with an alpha value of 1.0
hsb(120, 255,  255)                     full green in hsb
hsba(120, 255,  255,  1.0)              the same, with an alpha value of 1.0
hsl(120, 100%,  50%)                    full green in hsl
hsla(120, 100%,  50%,  1.0)             the same, with an alpha value of 1.0
hsl(120, 255,  127.5)                   full green in hsl
hsla(120, 255,  127.5,  1.0)            the same, with an alpha value of 1.0
cielab(62.253188, 23.950124, 48.410653)
icc-color(cmyk, 0.11, 0.48, 0.83, 0.00)  cymk
icc-color(rgb, 1, 0, 0)                  linear rgb
icc-color(rgb, red)                      linear rgb
icc-color(lineargray, 0.5)               linear gray
icc-color(srgb, 1, 0, 0)                 non-linear rgb
icc-color(srgb, red)                     non-linear rgb
icc-color(gray, 0.5)                     non-linear gray

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM