简体   繁体   English

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

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

I found the following documentation in a bash script written for use with some software named, " imagemagick " 我在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

I cannot fathom what the code author considered to be a "valid IM color." 我无法理解代码作者认为的“有效IM颜色”。 I am guessing that "IM" is simply an abbreviation of "image," but perhaps "instant messaging," or something else was meant. 我猜“IM”只是“图像”的缩写,但也许是“即时通讯”,或其他意思。 What do you think? 你怎么看?

A hex code for RGB would have blue in the lower byte, green in the middle byte, and red in the upper byte, but I am not sure whether they use standard RGB encoding for colors or not. RGB的十六进制代码在低位字节中为蓝色,在中间字节中为绿色,在高位字节中为红色,但我不确定它们是否对颜色使用标准RGB编码。

Multicrop2 is my script. Multicrop2是我的脚本。 A valid ImageMagick color is any color scheme that ImageMagick recognizes, such as rgb, hex, cmyk, hsl, and even color names in the format specified in its documentation and especially at http://www.imagemagick.org/script/color.php . 有效的ImageMagick颜色是ImageMagick识别的任何颜色方案,例如rgb,hex,cmyk,hsl,甚至是其文档中指定格式的颜色名称,尤其是http://www.imagemagick.org/script/color。 PHP There are too many to list in my script. 在我的脚本中列出的内容太多了。 Often I refer to this link, but apparently in this case I did not. 我经常提到这个链接,但显然在这种情况下我没有。 But most ImageMagick users are aware of its typical color schemes. 但大多数ImageMagick用户都知道它的典型配色方案。 ImageMagick users mostly know that IM is an abbreviation for ImageMagick. ImageMagick用户大多知道IM是ImageMagick的缩写。 Colors follow the CSS stye guide for the most part. 颜色大部分遵循CSS stye指南。 Colors with #, spaces or parentheses, need to be quoted, at least on Unix-like systems. 带#,空格或括号的颜色需要引用,至少在类Unix系统上。 Color names do not need quoting. 颜色名称不需要引用。 Apologies to newbies to my scripts and ImageMagick. 向我的脚本和ImageMagick的新手道歉。

Examples: 例子:

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