Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: that darned RGB problem
From: John Dowdell
Date: Fri, 3 Nov 2000 01:07:52 GMT

Sorry, I didn't catch the previous parts of the thread... I read the recent
post but wasn't sure why my name was inserted in the title. (If this is a
wishlist request, then mailing to wish-flashatmacromedia [dot] com can reach the
folks who make the tool, thanks.)

Are you trying to convert color representations? If so, then Gary Grossman
offers two bitwise manipulations which can help... here are fragments from
two messages, for both sides of the task:


>RE: technique to create a hex for RGB?
>
>What you want is
>
>RGBValue = (rv<<16) | (gv<<8) | bv;
>
>Each value from 0 to 255 is an 8-bit byte, or 8 binary digits.
>
>A hex RGB color of the form #XXXXXX is a 24-bit quantity,
>or 24 binary digits.
>
>The << operator shifts quantities by the specified number of bits. Here,
>it's used to shift each 8-bit byte into the proper position in the 24-bit
>whole.



>> Would you guys happen to have a recipe for extracting red, green,
>> and blue from c.getRGB() using bitwise shifting, or do I just have
>> to go the old-fashioned way and use substrings?
>
>r = (rgb >> 16) & 0xff;
>g = (rgb >> 8) & 0xff;
>b = rgb & 0xff;



I haven't had the chance to work in this area before, but did some quick
tests this afternoon, with much happiness. I agree that it would be great
to get this stuff documented... will be working on a technote with an easy
intro to some of this stuff, thanks.


Tip: The front section of the ActionScript Dictionary contains the
non-alphabetical entries, and there's _all types_ of fascinating stuff in
there.... ;-)


jd





John Dowdell, Macromedia Tech Support, San Francisco CA US
Search technotes: http://www.macromedia.com/support/search/
Offlist email risks capture by the spam filters. I may not see your
email if it's not on the list. Private one-on-one email options are
available via Priority Access: http://www.macromedia.com/support/



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
November 27-29, 2000, LONDON, National Film Theatre

Produced by United Digital Artists and lynda.com
-Sponsored by Macromedia, Adobe Systems and Apple Computer
-http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
Register before November 10 and save £200
http:// www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  FLASH: Stronger Flash Player, Benoit Martin

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]