You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Justin Mclean (JIRA)" <ji...@apache.org> on 2017/02/14 22:00:43 UTC

[jira] [Comment Edited] (FLEX-35261) [FlexJS] background colour not set when using RGB values

    [ 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)