AppleScript-将文本从RGB转换为CMYK颜色值

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AppleScript-将文本从RGB转换为CMYK颜色值相关的知识,希望对你有一定的参考价值。

Stolen from stetho -- All thanks to AppleScript to convert CMYK to RGB values http://bit.ly/eP2mXS
  1. on cmykrgb(c, m, y, k)
  2.  
  3. set r to 255 - (round (2.55 * (c + k)))
  4. set g to 255 - (round (2.55 * (m + k)))
  5. set b to 255 - (round (2.55 * (y + k)))
  6.  
  7. if (r < 0) then set r to 0
  8. if (g < 0) then set g to 0
  9. if (b < 0) then set b to 0
  10.  
  11. return {r, g, b}
  12. end cmykrgb

以上是关于AppleScript-将文本从RGB转换为CMYK颜色值的主要内容,如果未能解决你的问题,请参考以下文章