Hi Alex,

for SWF I think we should have something like [1] [2]

what I don't know right now is what does royale compiler under the hood to
bring the "linear-gradient" values to the flash part, maybe generate some
AS3 code? from there we can get those values and use in the flash code
similar to the ones in the links posted right?

[1] https://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/
WS5b3ccc516d4fbf351e63e3d118a9b90204-7dd7.html
[2] http://snipplr.com/view/15005/

For the compiler part, I'm really have to check for:

background-image: linear-gradient(#3BB0FF, #1E36FA);

or

background: linear-gradient(#3BB0FF, #1E36FA);

not for backgrounColor(s), but I suppose is the same

(in this last case I guest we have some actual problems since in that
compact mode, people could write many optional things and maybe this are
not processed right for the compiler.

thanks


2018-03-06 17:36 GMT+01:00 Alex Harui <aha...@adobe.com.invalid>:

> Hi Carlos,
>
> If you can find a way to handle linear-gradient for SWF that would be
> great.  I don't know this area of the code that well, but I think you have
> at least 3 choices:
>
> 1) Alter the AST
> 2) Output a String
> 3) Reduce it to a function call.
>
> FWIW, #3 requires changing the reducer which seems scary.  I think I've
> avoided it so far.
>
> Options #1 and #2 are similar.  I think you can see that the parsing sets
> up a data structure with things like CSSRgbColorPropertyValue and
> CSSFunctionCallPropertyValue.  It should be possible to see that a
> CSSFunctionCallPropertyValue is a linear-gradient and swap it out for some
> other CSS structure that represents what the parser would have generated
> for:
>
> #1:  backgroundColors: #000000, #123456;
> #2:  backgroundColor: "linearGradient(#000000, #123456)"
>
> For #1, there seems to already be custom styles that end with "xxxColors"
> (note plural) that have a list of colors.
> For #2, you are trying to set backgroundColor to a String that the
> framework could parse at runtime.
>
> Good luck,
> -Alex
>
>
> On 3/6/18, 4:16 AM, "carlos.rov...@gmail.com on behalf of Carlos Rovira"
> <carlos.rov...@gmail.com on behalf of carlosrov...@apache.org> wrote:
>
> >Hi Alex,
> >
> >I'm looking into CSS compiler files and trying to see what to do. This for
> >the momento exceeds me, but I'll try to continue trying to understand this
> >part, but will need cross various emails with you:
> >
> >For this one:
> >
> >https://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fgithub.co
> >m%2Fapache%2Froyale-compiler%2Fissues%2F26&data=02%7C01%
> 7Caharui%40adobe.c
> >om%7C5cf94961f3994e02456208d5835c29f8%7Cfa7b1b5a7b34438794aed2c178de
> cee1%7
> >C0%7C0%7C636559354222273618&sdata=jCD9%2FvfKxdW0TKwiJhMO%
> 2FI7zwGI6cWaMQUYP
> >oTMk%2BJo%3D&reserved=0
> >
> >I assume the point is in CSSReducer class (line 530), then I need to deal
> >with CSSFunctionCallPropertyValue
> >
> >but first of all is what to do with  *linear-gradient(#3BB0FF, #1E36FA)'*
> >in SWF
> >
> >I think this value could not be valid in SWF for "background", but in that
> >case:
> >
> >* we can make it valid
> >
> >or
> >
> >* maybe for SWF there's some way to discriminate css rules for SWF and for
> >JS?
> >
> >(In the end if we want JS and SWF match, I think we should support
> >linear-gradients in SWF in some way
> >
> >Thanks
> >
> >--
> >Carlos Rovira
> >https://na01.safelinks.protection.outlook.com/?url=
> http%3A%2F%2Fabout.me%2
> >Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%
> 7C5cf94961f3994e02456208d5
> >835c29f8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%
> 7C636559354222273618&s
> >data=XOjs%2B44XE3iak7IvBiX3lajtbDPUe6XPBCKPg%2FGUqLU%3D&reserved=0
>
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Reply via email to