• 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
Re: Yosemite decimal number conversion error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Yosemite decimal number conversion error


  • Subject: Re: Yosemite decimal number conversion error
  • From: Brian Christmas <email@hidden>
  • Date: Wed, 29 Oct 2014 17:54:06 +1100

G’day once more Shane.

Thanks for your reply.

Would you (and anyone else) mind trying this code snippet, please?

On my March 2013 i7 27” iMac with a NVIDIA GeForce GTX 680MX 2048 MB   it returns…

Apple color Black Red = 0.0 Green = 0.0 Blue = 0.0
Apple color Blue Red = 0.0 Green = 0.0 Blue = 1.0
Apple color Brown Red = 0.600000023842 Green = 0.40000000596 Blue = 0.20000000298
Apple color Cyan Red = 0.0 Green = 1.0 Blue = 1.0
Apple color Green Red = 0.0 Green = 1.0 Blue = 0.0
Apple color Magenta Red = 1.0 Green = 0.0 Blue = 1.0
Apple color Orange Red = 1.0 Green = 0.5 Blue = 0.0
Apple color Purple Red = 0.5 Green = 0.0 Blue = 0.5
Apple color Red Red = 1.0 Green = 0.0 Blue = 0.0
Apple color Yellow Red = 1.0 Green = 1.0 Blue = 0.0
Apple color White Red = 1.0 Green = 1.0 Blue = 1.0

Regards

Santa

Snippet…


-- Created 2014-10-29 17:15:45 +1100 by Brian Christmas
-- © 2014 Brian Christmas, MeSelfSoftware
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
-- use framework "AppKit"

tell current application's NSColorList to set AppleColors to colorListNamed_("Apple")
tell current application to set colorKeysList to AppleColors's allKeys() as list
set colorDisplay to {}
repeat with x from 1 to count of colorKeysList
set theRequiredNSColor to (AppleColors's colorWithKey:(item x of colorKeysList))
set theRGBValuesToDisplay to "Apple color " & item x of colorKeysList & tab & "Red = " & theRequiredNSColor's redComponent() & tab & "Green = " & theRequiredNSColor's greenComponent() & tab & "Blue = " & theRequiredNSColor's blueComponent() as text
set end of colorDisplay to theRGBValuesToDisplay & return as text
end repeat

display dialog colorDisplay as text



On 29 Oct 2014, at 5:12 pm, Shane Stanley <email@hidden> wrote:

On 29 Oct 2014, at 3:44 pm, Brian Christmas <email@hidden> wrote:

Is anyone able to explain why the discrepancy please?

No idea. This:

use AppleScript version "2.4"
use framework "Foundation"
use scripting additions

set theRequiredNSColor to current application's NSColor's brownColor()
set theRGBValuesToDisplay to "Values:  " & return & theRequiredNSColor's redComponent() & " " & theRequiredNSColor's greenComponent() & " " & theRequiredNSColor's blueComponent() as text

returns:

--> "Values:  
0.6 0.4 0.2"


-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
Do not post admin requests to the list. They will be ignored. applescriptobjc-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Yosemite decimal number conversion error
      • From: Shane Stanley <email@hidden>
References: 
 >Re: Yosemite decimal number conversion error (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Yosemite decimal number conversion error
  • Next by Date: Re: Yosemite decimal number conversion error
  • Previous by thread: Re: Yosemite decimal number conversion error
  • Next by thread: Re: Yosemite decimal number conversion error
  • Index(es):
    • Date
    • Thread