Not yet rated

Problem

I would like to see an example that shows how to use a color transform in FXG.

Solution

Color transform can be used to change the tint, brightness and opacity of a group in FXG. Attributes available are alphaMultiplier, alphaOffset, blueMultiplier, blueOffset, greenMultiplier, greenOffset, redMultiplier and redOffset.

Detailed explanation

Below is an FXG file with name MyRect.fxg

        <Graphic xmlns="http://ns.adobe.com/fxg/2008" version="2">    
   <Group>
    <transform>
   <Transform> 
   <colorTransform>
   <ColorTransform alphaMultiplier=".9">
   </ColorTransform>
   </colorTransform>
   </Transform> 
    </transform>
        <Rect width="200" height="200">
<fill>
<SolidColor color="#FF0000" />
</fill>
<stroke>
<SolidColorStroke weight="10" color="#0000FF" alpha="1" />
</stroke>
</Rect>
   </Group>
</Graphic>
   

 
  
This FXG can be used in MXML file by adding the code:
        <local:MyRect x="169" y="130"/>
 
 
 
 
 
  

+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes