OS X ColorPicker in: AppleScript
The OS X ColorPicker has a few nifty tricks up its sleeves. Drop an image into the well of the image pane and, you guessed it, you can use that pic in the ColorPicker every time you call the ColorPicker. You have dozens of swatch spots available, RGB, CMYK and HSV sliders, plus it supports third party pickers. I suggest using it where ever you can.
Clicked this page (Joshuaink: Sexy "Free" OS X Apps) while searching for a hex colorpicker. It contains a suggestion for an AppleScript to call the ColorPicker as well as a link to a couple of neat colorpickers.
My script uses the RBG2HTML sub-routine available from Apple to convert the RGB value array into an HTML 8-bit hex color value and places the string into the clipboard.
See: AppleScript Guidebook: Essential Sub-Routines
Clicked this page (Joshuaink: Sexy "Free" OS X Apps) while searching for a hex colorpicker. It contains a suggestion for an AppleScript to call the ColorPicker as well as a link to a couple of neat colorpickers.
My script uses the RBG2HTML sub-routine available from Apple to convert the RGB value array into an HTML 8-bit hex color value and places the string into the clipboard.
set theColor to (choose color) set the clipboard to my RGB2HTML(theColor) on RGB2HTML(RGB_values) -- NOTE: this sub-routine expects the RBG values to be from 0 to 65536 set the hex_list to ¬ {"0", "1", "2", "3", "4", "5", "6", "7", "8", ¬ "9", "A", "B", "C", "D", "E", "F"} set the the hex_value to "" repeat with i from 1 to the count of the RGB_values set this_value to (item i of the RGB_values) div 256 if this_value is 256 then set this_value to 255 set x to item ((this_value div 16) + 1) of the hex_list set y to item (((this_value / 16 mod 1) * 16) + 1) of the hex_list set the hex_value to (the hex_value & x & y) as string end repeat return ("#" & the hex_value) as string end RGB2HTML
See: AppleScript Guidebook: Essential Sub-Routines

