Re: Converting an RGB color back into an 16-bit-per-channel color
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