You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Alex Harui <ah...@adobe.com> on 2016/10/27 15:05:44 UTC

[FLEXJS] Colors (was Re: [FlexJS] HTMLElementWrapper extending Sprite)


On 10/26/16, 11:59 PM, "Harbs" <ha...@gmail.com> wrote:

>There’s also an issue that Flash uses ARGB, while the default in browsers
>seems to be RGBA.
>
>I think simply avoiding uint representations of RGBA is the simplest
>solution…

Not quite sure what you mean by that.  Are you suggesting that we add an
RGB and RGBA class and use it instead of uint in our APIs?  I think that
might be worth a try.  It looks like there is an RGBColor class in JS.swc
already.  

Thoughts?
-Alex


Re: [FLEXJS] Colors (was Re: [FlexJS] HTMLElementWrapper extending Sprite)

Posted by Alex Harui <ah...@adobe.com>.

On 10/28/16, 2:52 AM, "Harbs" <ha...@gmail.com> wrote:

>There’s two ways to represent RGB with alpha as a uint:
>
>AARRGGBB (or 0xAARRGGBB)
>and
>RRGGBBAA (or 0xRRGGBBAA)
>
>The two quite obviously have very different numeric representations.
>
>The standard for HTML is RRGGBBAA.

Right, so wouldn't having actual RGB and RGBA classes instead of uint in
our APIs help us solve this problem?  I'm assuming that's what you are
suggesting?  The toValue() for RGBA would be different based on platform.

-Alex


Re: [FLEXJS] Colors (was Re: [FlexJS] HTMLElementWrapper extending Sprite)

Posted by Harbs <ha...@gmail.com>.
There’s two ways to represent RGB with alpha as a uint:

AARRGGBB (or 0xAARRGGBB)
and
RRGGBBAA (or 0xRRGGBBAA)

The two quite obviously have very different numeric representations.

The standard for HTML is RRGGBBAA.

On Oct 27, 2016, at 6:05 PM, Alex Harui <ah...@adobe.com> wrote:

> 
> 
> On 10/26/16, 11:59 PM, "Harbs" <ha...@gmail.com> wrote:
> 
>> There’s also an issue that Flash uses ARGB, while the default in browsers
>> seems to be RGBA.
>> 
>> I think simply avoiding uint representations of RGBA is the simplest
>> solution…
> 
> Not quite sure what you mean by that.  Are you suggesting that we add an
> RGB and RGBA class and use it instead of uint in our APIs?  I think that
> might be worth a try.  It looks like there is an RGBColor class in JS.swc
> already.  
> 
> Thoughts?
> -Alex
>