Re: Tex-Edit X: Web snapping colors
Re: Tex-Edit X: Web snapping colors
- Subject: Re: Tex-Edit X: Web snapping colors
- From: Kai Edwards <email@hidden>
- Date: Sat, 23 Nov 2002 11:05:55 +0000
on 22/11/02 4:21 pm, Gnarlodious at email@hidden wrote:
>
Muchas gracias to JJ, has and specially Kai for helping hammer this out.
>
Just what I wanted for my colorcoded Stylesheets!
You're most welcome, Rachel.
>
--Hex triplet alfa must be Ucase
If you want to incorporate a conversion from Lcase to Ucase, then you could
try something like this:
===============================================================
on hexToRGB(tx)
set {tid, tx, hx, lC, rgb} to {text item delimiters, [NO BREAK]
tx's text -6 thru -1, "0123456789ABCDEF", "abcdef", {}}
repeat with n from 1 to 6 by 2
set col to 0
repeat with x from 0 to 1
tell 1 - x to set {num, char} to [NO BREAK]
{16 ^ it + 16 ^ (it + 2), tx's character (n + x)}
considering case
if char is in lC then set char to [NO BREAK]
ASCII character ((ASCII number char) - 32)
end considering
set text item delimiters to char
set col to col + (hx's text item 1's length) * num
end repeat
set rgb's end to col
end repeat
set text item delimiters to tid
rgb
end hexToRGB
===============================================================
I'd also like to add my personal thanks to Tom Bender - for producing such
an exceptionally scriptable application as Tex-Edit! :-)
Kai
--
email@hidden
email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.