flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Mclean (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (FLEX-35261) [FlexJS] background colour not set when using RGB values
Date Tue, 14 Feb 2017 22:00:43 GMT

    [ https://issues.apache.org/jira/browse/FLEX-35261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15866791#comment-15866791
] 

Justin Mclean edited comment on FLEX-35261 at 2/14/17 10:00 PM:
----------------------------------------------------------------

The reason this doesn't work due to the code in applyStyles:

{code}
if (typeof(value) == 'number') {
      if (colorStyles[p])
        value = org.apache.flex.utils.CSSUtils.attributeFromColor(value);
      else
        value = value.toString() + 'px';
{code}

colorStyles contains a list of styles that expect RGB colours however it contains backgroundColor
not background-color so attributeFromColor is not called.

Possible solution is to extend colorStyles to include both backgroundColor and background-color
or transform any CCS with a hyphen to it's other form.


was (Author: jmclean):
The reason this doesn't work is teh code in apply Styles:

{code}
if (typeof(value) == 'number') {
      if (colorStyles[p])
        value = org.apache.flex.utils.CSSUtils.attributeFromColor(value);
      else
        value = value.toString() + 'px';
{code}

colorStyles contains a list of styles that expect RGB colours however it contains backgroundColor
not background-color so attributeFromColor is not called.

Possible solution is to extend colorStyles to include both backgroundColor and background-color
or transform any CCS with a hyphen to it's other form.

> [FlexJS] background colour not set when using RGB values
> --------------------------------------------------------
>
>                 Key: FLEX-35261
>                 URL: https://issues.apache.org/jira/browse/FLEX-35261
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: FlexJS
>    Affects Versions: Apache FlexJS 0.8.0
>            Reporter: Justin Mclean
>
> This code using a named colour works:
> {code}
> <?xml version="1.0" encoding="utf-8"?>
> <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>                xmlns:js="library://ns.apache.org/flexjs/basic">
>    <js:valuesImpl>
>        <js:SimpleCSSValuesImpl/>
>    </js:valuesImpl>
>    <js:initialView>
>        <js:View percentWidth="100" percentHeight="100" style="background-color:red;">
>        </js:View>
>    </js:initialView>
> </js:Application>
> {code}
> However using a RGB value like this doesn’t work:
> {code}
> <js:initialView>
>    <js:View percentWidth="100" percentHeight="100" style="background-color:#FF0000;">
>    </js:View>
> </js:initialView>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message