상세 컨텐츠

본문 제목

[flex4] colorUtil 사용하기

FLEX

by 코드공작소 2010. 8. 11. 11:11

본문

반응형

http://www.jamesward.com/2010/07/30/how-to-define-styles-on-skins-in-flex-4/



<?xml version="1.0"?>
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
  xmlns:s="library://ns.adobe.com/flex/spark">
 
  <fx:Script>
    import mx.utils.ColorUtil;
  </fx:Script>
 
  <s:states>
    <s:State name="up"/>
    <s:State name="over"/>
    <s:State name="down"/>
  </s:states>
 
  <s:Rect width="100%" height="100%">
    <s:fill>
      <s:SolidColor color="{getStyle('backgroundColor')}"
                    color.over="{ColorUtil.adjustBrightness2(getStyle('backgroundColor'), 64)}"
                    color.down="{ColorUtil.adjustBrightness2(getStyle('backgroundColor'), -32)}"
      />
    </s:fill>
  </s:Rect>
 
  <s:Label id="labelDisplay" paddingBottom="3" paddingLeft="3" paddingRight="3" paddingTop="6"/>
 
</s:SparkSkin>
반응형

관련글 더보기