|
|
|
Copy RGB or HEX color values from the Color Picker
I use this script to do it. It returns (in the clipboard) the BBCode, Decimal Number, or HTML code for the color chosen.
<code>set C10 to choose color default color {50000, 50000, 50000} set Val16 to "" repeat with C in C10 if contents of C = 0 then set Val16 to Val16 & "00" else set Val16 to Val16 & |10->16|(C) -- as 8-bit colors end if end repeat set B to button returned of (display dialog "The color values for the color chosen:" & return & return & Val16 default button 3 buttons {"BB to Clip", "Num to Clip", "HTML to Clip"}) if B = "BB to Clip" then set the clipboard to "[color=#" & Val16 & "]" else if B = "Num to Clip" then set the clipboard to Val16 else set the clipboard to "<font color=\"#" & Val16 & "\">" end if on |10->16|(n10) set n10 to n10 div 256 -- to get 8-bit if n10 is less than 0 then set n10 to -n10 set Ch16 to "0123456789ABCDEF" set Txt16 to "" set N to n10 set Dgt16 to 1 repeat if N is 0 then exit repeat set nx to N div Dgt16 set mx to nx mod 16 set Txt16 to (character (mx + 1) of Ch16) & Txt16 set N to N - (mx * Dgt16) set Dgt16 to (Dgt16 * 16) end repeat if length of Txt16 = 1 then set Txt16 to "0" & Txt16 return Txt16 end |10->16|</code> |
SearchFrom our Sponsor...What's New:HintsNo new hintsComments last 2 days
Links last 2 weeksNo recent new linksWhat's New in the Forums?
The Editor's Corner...Here are some of my (robg) other projects...
Hints by TopicNews from Macworld
The macosxhints PollWhat version of OS X are you running as your main OS?
Other polls | 11,349 votes | 42 comments
|
|
Copyright © 2009 Mac Publishing LLC (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.03 seconds |
|