• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Tex-Edit X: Web snapping colors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Tex-Edit X: Web snapping colors (From: Kai Edwards <email@hidden>)

  • Prev by Date: Re: Number of days left in the month
  • Next by Date: Re: lock the screen from the keyboard, win a prize
  • Previous by thread: Re: Tex-Edit X: Web snapping colors
  • Next by thread: Re: Tex-Edit: What OSAX is this using?
  • Index(es):
    • Date
    • Thread