Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

Miscellaneous methods

Method

componentsOfColor:

Summary

This provides access to the result of the -getComponents method of NSColor.

Signature

+ (NSArray *)componentsOfColor:(NSColor *)theColor

Parameters

theColor = an NSColor

Result

Array of component values. The number depends on the color type.

Availability

Version 1.2.0

Notes

 

Sample

use scripting additions

use framework "Foundation"

use script "BridgePlus"

load framework


set theColor to current application's NSColor's brownColor()

set theResult to current application's SMSForder's componentsOfColor:theColor

ASify from theResult

--> {0.6, 0.4, 0.2, 1.0}

theResult as list -- 10.11 only

--> {0.6, 0.4, 0.2, 1.0}

theResult as list -- 10.9 and 10.10

--> <as above, but real values lose precision>


set theColor to current application's NSColor's colorWithDeviceWhite:0.5 alpha:1.0

set theResult to current application's SMSForder's componentsOfColor:theColor

ASify from theResult

--> {0.5, 1.0}

theResult as list -- 10.11 only

--> {0.5, 1.0}

theResult as list -- 10.9 and 10.10

--> <as above, but real values lose precision>


Click here to open script in a script editor