ColorPicker.pas 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. {
  2. File: CommonPanels/ColorPicker.h
  3. Contains: Color Picker package Interfaces.
  4. Version: CommonPanels-94~602
  5. Copyright: © 1987-2008 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  12. {
  13. Modified for use with Free Pascal
  14. Version 308
  15. Please report any bugs to <[email protected]>
  16. }
  17. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  18. {$mode macpas}
  19. {$packenum 1}
  20. {$macro on}
  21. {$inline on}
  22. {$calling mwpascal}
  23. unit ColorPicker;
  24. interface
  25. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  26. {$setc GAP_INTERFACES_VERSION := $0308}
  27. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  28. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  29. {$endc}
  30. {$ifc defined CPUPOWERPC and defined CPUI386}
  31. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  32. {$endc}
  33. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  34. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  35. {$endc}
  36. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  37. {$setc __ppc__ := 1}
  38. {$elsec}
  39. {$setc __ppc__ := 0}
  40. {$endc}
  41. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  42. {$setc __ppc64__ := 1}
  43. {$elsec}
  44. {$setc __ppc64__ := 0}
  45. {$endc}
  46. {$ifc not defined __i386__ and defined CPUI386}
  47. {$setc __i386__ := 1}
  48. {$elsec}
  49. {$setc __i386__ := 0}
  50. {$endc}
  51. {$ifc not defined __x86_64__ and defined CPUX86_64}
  52. {$setc __x86_64__ := 1}
  53. {$elsec}
  54. {$setc __x86_64__ := 0}
  55. {$endc}
  56. {$ifc not defined __arm__ and defined CPUARM}
  57. {$setc __arm__ := 1}
  58. {$elsec}
  59. {$setc __arm__ := 0}
  60. {$endc}
  61. {$ifc defined cpu64}
  62. {$setc __LP64__ := 1}
  63. {$elsec}
  64. {$setc __LP64__ := 0}
  65. {$endc}
  66. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  67. {$error Conflicting definitions for __ppc__ and __i386__}
  68. {$endc}
  69. {$ifc defined __ppc__ and __ppc__}
  70. {$setc TARGET_CPU_PPC := TRUE}
  71. {$setc TARGET_CPU_PPC64 := FALSE}
  72. {$setc TARGET_CPU_X86 := FALSE}
  73. {$setc TARGET_CPU_X86_64 := FALSE}
  74. {$setc TARGET_CPU_ARM := FALSE}
  75. {$setc TARGET_OS_MAC := TRUE}
  76. {$setc TARGET_OS_IPHONE := FALSE}
  77. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  78. {$setc TARGET_OS_EMBEDDED := FALSE}
  79. {$elifc defined __ppc64__ and __ppc64__}
  80. {$setc TARGET_CPU_PPC := FALSE}
  81. {$setc TARGET_CPU_PPC64 := TRUE}
  82. {$setc TARGET_CPU_X86 := FALSE}
  83. {$setc TARGET_CPU_X86_64 := FALSE}
  84. {$setc TARGET_CPU_ARM := FALSE}
  85. {$setc TARGET_OS_MAC := TRUE}
  86. {$setc TARGET_OS_IPHONE := FALSE}
  87. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  88. {$setc TARGET_OS_EMBEDDED := FALSE}
  89. {$elifc defined __i386__ and __i386__}
  90. {$setc TARGET_CPU_PPC := FALSE}
  91. {$setc TARGET_CPU_PPC64 := FALSE}
  92. {$setc TARGET_CPU_X86 := TRUE}
  93. {$setc TARGET_CPU_X86_64 := FALSE}
  94. {$setc TARGET_CPU_ARM := FALSE}
  95. {$ifc defined(iphonesim)}
  96. {$setc TARGET_OS_MAC := FALSE}
  97. {$setc TARGET_OS_IPHONE := TRUE}
  98. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  99. {$elsec}
  100. {$setc TARGET_OS_MAC := TRUE}
  101. {$setc TARGET_OS_IPHONE := FALSE}
  102. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  103. {$endc}
  104. {$setc TARGET_OS_EMBEDDED := FALSE}
  105. {$elifc defined __x86_64__ and __x86_64__}
  106. {$setc TARGET_CPU_PPC := FALSE}
  107. {$setc TARGET_CPU_PPC64 := FALSE}
  108. {$setc TARGET_CPU_X86 := FALSE}
  109. {$setc TARGET_CPU_X86_64 := TRUE}
  110. {$setc TARGET_CPU_ARM := FALSE}
  111. {$setc TARGET_OS_MAC := TRUE}
  112. {$setc TARGET_OS_IPHONE := FALSE}
  113. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  114. {$setc TARGET_OS_EMBEDDED := FALSE}
  115. {$elifc defined __arm__ and __arm__}
  116. {$setc TARGET_CPU_PPC := FALSE}
  117. {$setc TARGET_CPU_PPC64 := FALSE}
  118. {$setc TARGET_CPU_X86 := FALSE}
  119. {$setc TARGET_CPU_X86_64 := FALSE}
  120. {$setc TARGET_CPU_ARM := TRUE}
  121. { will require compiler define when/if other Apple devices with ARM cpus ship }
  122. {$setc TARGET_OS_MAC := FALSE}
  123. {$setc TARGET_OS_IPHONE := TRUE}
  124. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  125. {$setc TARGET_OS_EMBEDDED := TRUE}
  126. {$elsec}
  127. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
  128. {$endc}
  129. {$ifc defined __LP64__ and __LP64__ }
  130. {$setc TARGET_CPU_64 := TRUE}
  131. {$elsec}
  132. {$setc TARGET_CPU_64 := FALSE}
  133. {$endc}
  134. {$ifc defined FPC_BIG_ENDIAN}
  135. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  136. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  137. {$elifc defined FPC_LITTLE_ENDIAN}
  138. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  139. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  140. {$elsec}
  141. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  142. {$endc}
  143. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  144. {$setc CALL_NOT_IN_CARBON := FALSE}
  145. {$setc OLDROUTINENAMES := FALSE}
  146. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  147. {$setc OPAQUE_UPP_TYPES := TRUE}
  148. {$setc OTCARBONAPPLICATION := TRUE}
  149. {$setc OTKERNEL := FALSE}
  150. {$setc PM_USE_SESSION_APIS := TRUE}
  151. {$setc TARGET_API_MAC_CARBON := TRUE}
  152. {$setc TARGET_API_MAC_OS8 := FALSE}
  153. {$setc TARGET_API_MAC_OSX := TRUE}
  154. {$setc TARGET_CARBON := TRUE}
  155. {$setc TARGET_CPU_68K := FALSE}
  156. {$setc TARGET_CPU_MIPS := FALSE}
  157. {$setc TARGET_CPU_SPARC := FALSE}
  158. {$setc TARGET_OS_UNIX := FALSE}
  159. {$setc TARGET_OS_WIN32 := FALSE}
  160. {$setc TARGET_RT_MAC_68881 := FALSE}
  161. {$setc TARGET_RT_MAC_CFM := FALSE}
  162. {$setc TARGET_RT_MAC_MACHO := TRUE}
  163. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  164. {$setc TYPE_BOOL := FALSE}
  165. {$setc TYPE_EXTENDED := FALSE}
  166. {$setc TYPE_LONGLONG := TRUE}
  167. uses MacTypes,ColorSyncDeprecated,MixedMode,QuickdrawTypes,Events;
  168. {$endc} {not MACOSALLINCLUDE}
  169. {$ifc TARGET_OS_MAC}
  170. {$ALIGN MAC68K}
  171. {$ifc not TARGET_CPU_64}
  172. const
  173. {Maximum small fract value, as long}
  174. kMaximumSmallFract = $0000FFFF;
  175. {$endc} {not TARGET_CPU_64}
  176. { These are legacy constants. The Color Picker on OS X uses the Cocoa NSColorPanel. }
  177. const
  178. kDefaultColorPickerWidth = 383;
  179. kDefaultColorPickerHeight = 238;
  180. type
  181. DialogPlacementSpec = SInt16;
  182. const
  183. kAtSpecifiedOrigin = 0;
  184. kDeepestColorScreen = 1;
  185. kCenterOnMainScreen = 2;
  186. { Since OS X uses the Cocoa NSColorPanel, the flags below are no longer used. }
  187. const
  188. kColorPickerDialogIsMoveable = 1;
  189. kColorPickerDialogIsModal = 2;
  190. kColorPickerCanModifyPalette = 4;
  191. kColorPickerCanAnimatePalette = 8;
  192. kColorPickerAppIsColorSyncAware = 16;
  193. kColorPickerInSystemDialog = 32;
  194. kColorPickerInApplicationDialog = 64;
  195. kColorPickerInPickerDialog = 128;
  196. kColorPickerDetachedFromChoices = 256;
  197. kColorPickerCallColorProcLive = 512;
  198. {$ifc OLDROUTINENAMES}
  199. {$ifc not TARGET_CPU_64}
  200. const
  201. {Maximum small fract value, as long}
  202. MaxSmallFract = $0000FFFF;
  203. {$endc} {not TARGET_CPU_64}
  204. const
  205. kDefaultWidth = 383;
  206. kDefaultHeight = 238;
  207. { Since OS X uses the Cocoa NSColorPanel, the flags below are no longer used. }
  208. const
  209. DialogIsMoveable = 1;
  210. DialogIsModal = 2;
  211. CanModifyPalette = 4;
  212. CanAnimatePalette = 8;
  213. AppIsColorSyncAware = 16;
  214. InSystemDialog = 32;
  215. InApplicationDialog = 64;
  216. InPickerDialog = 128;
  217. DetachedFromChoices = 256;
  218. CallColorProcLive = 512;
  219. {$endc} {OLDROUTINENAMES}
  220. {$ifc not TARGET_CPU_64}
  221. { A SmallFract value is just the fractional part of a Fixed number,
  222. which is the low order word. They can be
  223. assigned directly to and from INTEGERs. }
  224. { Unsigned fraction between 0 and 1 }
  225. type
  226. SmallFract = UInt16;
  227. HSVColorPtr = ^HSVColor;
  228. HSVColor = record
  229. hue: SmallFract; { Fraction of circle, red at 0 }
  230. saturation: SmallFract; { 0-1, 0 for gray, 1 for pure color }
  231. value: SmallFract; { 0-1, 0 for black, 1 for max intensity }
  232. end;
  233. type
  234. HSLColorPtr = ^HSLColor;
  235. HSLColor = record
  236. hue: SmallFract; { Fraction of circle, red at 0 }
  237. saturation: SmallFract; { 0-1, 0 for gray, 1 for pure color }
  238. lightness: SmallFract; { 0-1, 0 for black, 1 for white }
  239. end;
  240. type
  241. CMYColorPtr = ^CMYColor;
  242. CMYColor = record
  243. cyan: SmallFract;
  244. magenta: SmallFract;
  245. yellow: SmallFract;
  246. end;
  247. type
  248. PMColor = record
  249. profile: CMProfileHandle;
  250. color: CMColor;
  251. end;
  252. PMColorPtr = ^PMColor;
  253. {$endc} {not TARGET_CPU_64}
  254. type
  255. NPMColor = record
  256. profile: CMProfileRef;
  257. color: CMColor;
  258. end;
  259. NPMColorPtr = ^NPMColor;
  260. type
  261. Picker = ^OpaquePicker; { an opaque type }
  262. OpaquePicker = record end;
  263. PickerPtr = ^Picker; { when a var xx:Picker parameter can be nil, it is changed to xx: PickerPtr }
  264. { Since OS X uses the Cocoa NSColorPanel, the struct below is no longer used. }
  265. type
  266. PickerMenuItemInfoPtr = ^PickerMenuItemInfo;
  267. PickerMenuItemInfo = record
  268. editMenuID: SInt16;
  269. cutItem: SInt16;
  270. copyItem: SInt16;
  271. pasteItem: SInt16;
  272. clearItem: SInt16;
  273. undoItem: SInt16;
  274. end;
  275. { The following proc ptr is the only supported way to communicate with the Cocoa NSColorPanel on OS X. }
  276. type
  277. NColorChangedProcPtr = procedure( userData: SRefCon; var newColor: NPMColor );
  278. NColorChangedUPP = NColorChangedProcPtr;
  279. {
  280. * NewNColorChangedUPP()
  281. *
  282. * Availability:
  283. * Mac OS X: in version 10.0 and later in Carbon.framework
  284. * CarbonLib: in CarbonLib 1.0 and later
  285. * Non-Carbon CFM: available as macro/inline
  286. }
  287. function NewNColorChangedUPP( userRoutine: NColorChangedProcPtr ): NColorChangedUPP; external name '_NewNColorChangedUPP';
  288. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  289. {
  290. * DisposeNColorChangedUPP()
  291. *
  292. * Availability:
  293. * Mac OS X: in version 10.0 and later in Carbon.framework
  294. * CarbonLib: in CarbonLib 1.0 and later
  295. * Non-Carbon CFM: available as macro/inline
  296. }
  297. procedure DisposeNColorChangedUPP( userUPP: NColorChangedUPP ); external name '_DisposeNColorChangedUPP';
  298. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  299. {
  300. * InvokeNColorChangedUPP()
  301. *
  302. * Availability:
  303. * Mac OS X: in version 10.0 and later in Carbon.framework
  304. * CarbonLib: in CarbonLib 1.0 and later
  305. * Non-Carbon CFM: available as macro/inline
  306. }
  307. procedure InvokeNColorChangedUPP( userData: SRefCon; var newColor: NPMColor; userUPP: NColorChangedUPP ); external name '_InvokeNColorChangedUPP';
  308. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  309. {$ifc TARGET_CPU_64}
  310. type
  311. ColorChangedUPP = UnivPtr;
  312. UserEventUPP = UnivPtr;
  313. {$elsec}
  314. type
  315. ColorChangedProcPtr = procedure( userData: SInt32; var newColor: PMColor );
  316. UserEventProcPtr = function( var event: EventRecord ): Boolean;
  317. ColorChangedUPP = ColorChangedProcPtr;
  318. UserEventUPP = UserEventProcPtr;
  319. {
  320. * NewColorChangedUPP()
  321. *
  322. * Availability:
  323. * Mac OS X: in version 10.0 and later in Carbon.framework
  324. * CarbonLib: in CarbonLib 1.0 and later
  325. * Non-Carbon CFM: available as macro/inline
  326. }
  327. function NewColorChangedUPP( userRoutine: ColorChangedProcPtr ): ColorChangedUPP; external name '_NewColorChangedUPP';
  328. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  329. {
  330. * NewUserEventUPP()
  331. *
  332. * Availability:
  333. * Mac OS X: in version 10.0 and later in Carbon.framework
  334. * CarbonLib: in CarbonLib 1.0 and later
  335. * Non-Carbon CFM: available as macro/inline
  336. }
  337. function NewUserEventUPP( userRoutine: UserEventProcPtr ): UserEventUPP; external name '_NewUserEventUPP';
  338. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  339. {
  340. * DisposeColorChangedUPP()
  341. *
  342. * Availability:
  343. * Mac OS X: in version 10.0 and later in Carbon.framework
  344. * CarbonLib: in CarbonLib 1.0 and later
  345. * Non-Carbon CFM: available as macro/inline
  346. }
  347. procedure DisposeColorChangedUPP( userUPP: ColorChangedUPP ); external name '_DisposeColorChangedUPP';
  348. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  349. {
  350. * DisposeUserEventUPP()
  351. *
  352. * Availability:
  353. * Mac OS X: in version 10.0 and later in Carbon.framework
  354. * CarbonLib: in CarbonLib 1.0 and later
  355. * Non-Carbon CFM: available as macro/inline
  356. }
  357. procedure DisposeUserEventUPP( userUPP: UserEventUPP ); external name '_DisposeUserEventUPP';
  358. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  359. {
  360. * InvokeColorChangedUPP()
  361. *
  362. * Availability:
  363. * Mac OS X: in version 10.0 and later in Carbon.framework
  364. * CarbonLib: in CarbonLib 1.0 and later
  365. * Non-Carbon CFM: available as macro/inline
  366. }
  367. procedure InvokeColorChangedUPP( userData: SInt32; var newColor: PMColor; userUPP: ColorChangedUPP ); external name '_InvokeColorChangedUPP';
  368. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  369. {
  370. * InvokeUserEventUPP()
  371. *
  372. * Availability:
  373. * Mac OS X: in version 10.0 and later in Carbon.framework
  374. * CarbonLib: in CarbonLib 1.0 and later
  375. * Non-Carbon CFM: available as macro/inline
  376. }
  377. function InvokeUserEventUPP( var event: EventRecord; userUPP: UserEventUPP ): Boolean; external name '_InvokeUserEventUPP';
  378. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  379. {$endc} {TARGET_CPU_64}
  380. {$ifc not TARGET_CPU_64}
  381. type
  382. ColorPickerInfo = record
  383. theColor: PMColor;
  384. dstProfile: CMProfileHandle;
  385. flags: UInt32;
  386. placeWhere: DialogPlacementSpec;
  387. dialogOrigin: Point;
  388. pickerType: OSType;
  389. eventProc: UserEventUPP;
  390. colorProc: ColorChangedUPP;
  391. colorProcData: UInt32;
  392. prompt: Str255;
  393. mInfo: PickerMenuItemInfo;
  394. newColorChosen: Boolean;
  395. filler: SInt8;
  396. end;
  397. {$endc} {not TARGET_CPU_64}
  398. type
  399. NColorPickerInfo = record
  400. theColor: NPMColor;
  401. dstProfile: CMProfileRef; { Currently ignored }
  402. flags: UInt32; { Currently ignored }
  403. placeWhere: DialogPlacementSpec; { Currently ignored }
  404. dialogOrigin: Point; { Currently ignored }
  405. pickerType: OSType; { Currently ignored }
  406. {$ifc not TARGET_CPU_64}
  407. eventProc: UserEventUPP; { Ignored }
  408. {$endc} {not TARGET_CPU_64}
  409. colorProc: NColorChangedUPP;
  410. colorProcData: URefCon;
  411. prompt: Str255; { Currently ignored }
  412. mInfo: PickerMenuItemInfo; { Ignored }
  413. newColorChosen: Boolean;
  414. reserved: UInt8; { Must be 0 }
  415. end;
  416. {$ifc not TARGET_CPU_64}
  417. {
  418. * Fix2SmallFract()
  419. *
  420. * Availability:
  421. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  422. * CarbonLib: in CarbonLib 1.0 and later
  423. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  424. }
  425. function Fix2SmallFract( f: Fixed ): SmallFract; external name '_Fix2SmallFract';
  426. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  427. {
  428. * SmallFract2Fix()
  429. *
  430. * Availability:
  431. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  432. * CarbonLib: in CarbonLib 1.0 and later
  433. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  434. }
  435. function SmallFract2Fix( s: SmallFract ): Fixed; external name '_SmallFract2Fix';
  436. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  437. {
  438. * CMY2RGB()
  439. *
  440. * Availability:
  441. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  442. * CarbonLib: in CarbonLib 1.0 and later
  443. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  444. }
  445. procedure CMY2RGB( const (*var*) cColor: CMYColor; var rColor: RGBColor ); external name '_CMY2RGB';
  446. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  447. {
  448. * RGB2CMY()
  449. *
  450. * Availability:
  451. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  452. * CarbonLib: in CarbonLib 1.0 and later
  453. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  454. }
  455. procedure RGB2CMY( const (*var*) rColor: RGBColor; var cColor: CMYColor ); external name '_RGB2CMY';
  456. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  457. {
  458. * HSL2RGB()
  459. *
  460. * Availability:
  461. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  462. * CarbonLib: in CarbonLib 1.0 and later
  463. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  464. }
  465. procedure HSL2RGB( const (*var*) hColor: HSLColor; var rColor: RGBColor ); external name '_HSL2RGB';
  466. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  467. {
  468. * RGB2HSL()
  469. *
  470. * Availability:
  471. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  472. * CarbonLib: in CarbonLib 1.0 and later
  473. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  474. }
  475. procedure RGB2HSL( const (*var*) rColor: RGBColor; var hColor: HSLColor ); external name '_RGB2HSL';
  476. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  477. {
  478. * HSV2RGB()
  479. *
  480. * Availability:
  481. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  482. * CarbonLib: in CarbonLib 1.0 and later
  483. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  484. }
  485. procedure HSV2RGB( const (*var*) hColor: HSVColor; var rColor: RGBColor ); external name '_HSV2RGB';
  486. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  487. {
  488. * RGB2HSV()
  489. *
  490. * Availability:
  491. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  492. * CarbonLib: in CarbonLib 1.0 and later
  493. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  494. }
  495. procedure RGB2HSV( const (*var*) rColor: RGBColor; var hColor: HSVColor ); external name '_RGB2HSV';
  496. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  497. {$endc} {not TARGET_CPU_64}
  498. {
  499. * GetColor()
  500. *
  501. * Availability:
  502. * Mac OS X: in version 10.0 and later in Carbon.framework
  503. * CarbonLib: in CarbonLib 1.0 and later
  504. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  505. }
  506. function GetColor( where: Point; const (*var*) prompt: Str255; const (*var*) inColor: RGBColor; var outColor: RGBColor ): Boolean; external name '_GetColor';
  507. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  508. {$ifc not TARGET_CPU_64}
  509. {
  510. * PickColor()
  511. *
  512. * Availability:
  513. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  514. * CarbonLib: in CarbonLib 1.0 and later
  515. * Non-Carbon CFM: in ColorPickerLib 2.0 and later
  516. }
  517. function PickColor( var theColorInfo: ColorPickerInfo ): OSErr; external name '_PickColor';
  518. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  519. {$endc} {not TARGET_CPU_64}
  520. {
  521. * NPickColor()
  522. *
  523. * Availability:
  524. * Mac OS X: in version 10.0 and later in Carbon.framework
  525. * CarbonLib: in CarbonLib 1.0 and later
  526. * Non-Carbon CFM: in ColorPickerLib 2.1 and later
  527. }
  528. function NPickColor( var theColorInfo: NColorPickerInfo ): OSErr; external name '_NPickColor';
  529. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  530. {$endc} {TARGET_OS_MAC}
  531. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  532. end.
  533. {$endc} {not MACOSALLINCLUDE}