• 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: Hex colors in Tex-Edit X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hex colors in Tex-Edit X


  • Subject: Re: Hex colors in Tex-Edit X
  • From: has <email@hidden>
  • Date: Thu, 21 Nov 2002 14:16:18 +0000

JJ wrote:

>> Anyone know the correct formula for converting 8-bit colour to 16-bit?

>on RGB_8bit_TO_RGB_16bit(rgb_8bit)
> set rgb_16bit to {}
> repeat with i in rgb_8bit
> set plain_decimal to i * 256
> set sum to plain_decimal div 256
> set rgb_16bit to rgb_16bit & (plain_decimal + sum)
> -- adjust plain decimal to base 256
> end repeat
> return rgb_16bit
>end RGB_8bit_TO_RGB_16bit

Thanks. Thought that might be it, but wanted to check. BTW, the above can
be simplified a bit:

======================================================================

on RGB_8bit_TO_RGB_16bit(rgb_8bit)
set rgb_16bit to {}
repeat with int in rgb_8bit
set rgb_16bit's end to (int * 256) + int
end repeat
return rgb_16bit
end RGB_8bit_TO_RGB_16bit

======================================================================

has

--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
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.

  • Prev by Date: Re: Number of days left in the month
  • Next by Date: Re: Number of days left in the month
  • Previous by thread: Re: Hex colors in Tex-Edit X
  • Next by thread: ASLG updated, slightly
  • Index(es):
    • Date
    • Thread