• 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: Converting an RGB color back into an 16-bit-per-channel color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting an RGB color back into an 16-bit-per-channel color


  • Subject: Re: Converting an RGB color back into an 16-bit-per-channel color
  • From: "Mark J. Reed" <email@hidden>
  • Date: Mon, 15 Aug 2011 07:28:50 -0400

Yup, arithmetically simplest is to multiply by 257.

In a language closer to the hardware, with efficient bitwise operations, it's better to left- shift by 8 bits and then OR with the original value.  We get used to thinking in those terms,  but in AppleScript that doesn't apply.

On Monday, August 15, 2011, Ron Hunsinger <email@hidden> wrote:
>
> On Aug 15, 2011, at 1:25 AM, Chris Page wrote:
>
>> Multiply the 8-bit value by 256 to shift it left by eight bits, then add it to the original 8-bit value to get the appropriate 16-bit value.
>
> Or more simply, just multiply by 257. _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
>

--
Mark J. Reed <email@hidden>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Converting an RGB color back into an 16-bit-per-channel color (From: Jim Thorton <email@hidden>)
 >Re: Converting an RGB color back into an 16-bit-per-channel color (From: Chris Page <email@hidden>)
 >Re: Converting an RGB color back into an 16-bit-per-channel color (From: Ron Hunsinger <email@hidden>)

  • Prev by Date: Re: Converting an RGB color back into an 16-bit-per-channel color
  • Next by Date: At the request of one of the list members...
  • Previous by thread: Re: Converting an RGB color back into an 16-bit-per-channel color
  • Next by thread: At the request of one of the list members...
  • Index(es):
    • Date
    • Thread