• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RGB to CMYK
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RGB to CMYK


  • Subject: RGB to CMYK
  • From: Jim Thorton <email@hidden>
  • Date: Mon, 23 May 2011 04:37:12 +0900

Dear AppleScripter,

Hello.  I can honestly say that I know little about the color.  I do know what the color depth means.  Anyway, when you pick a color through the Color Picker window, you will get different code representations like RGB, HSV, CMYK...  If t I have a color in RGB, I wonder how I can translate it into CMYK?  For example, if I have an RGB color of {228,255,91}, the color picker says its CMYK representation is {12,0,53,0}.  Is it possible for us to somehow get this translation easily with AppleScript?

In the meantime, I've found the following reverse translation code on multiple websites.


on cmykrgb(c, m, y, k)
 
    set r to 255 - (round (2.55 * (c + k)))
    set g to 255 - (round (2.55 * (m + k)))
    set b to 255 - (round (2.55 * (y + k)))
 
    if (r < 0) then set r to 0
    if (g < 0) then set g to 0
    if (b < 0) then set b to 0
 
    return {r, g, b}

end cmykrgb


If I select the following values, the AppleScript code above gives me {224,225,120}, which is not consistent with what the Color Picker window would give me.  So the reverse translation code simply doesn't work?


set c to 0
set m to 79
set y to 41
set k to 0


Thank you for your advice,

Jim
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: RGB to CMYK
      • From: Steve Thompson <email@hidden>
    • Re: RGB to CMYK
      • From: "Mark J. Reed" <email@hidden>
  • Prev by Date: Re: tell app, name in string var
  • Next by Date: Re: RGB to CMYK
  • Previous by thread: Re: tell to a process by id
  • Next by thread: Re: RGB to CMYK
  • Index(es):
    • Date
    • Thread