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:49:17 +0000
on 23/11/02 11:05 am, I wrote:
>
If you want to incorporate a conversion from Lcase to Ucase, then you could
>
try something like this:
(snip)
Actually, this is a little bit faster:
===============================================================
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
set char to tx's character (n + x)
tell 1 - x to set num to 16 ^ it + 16 ^ (it + 2)
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
===============================================================
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.