You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Chris Velevitch <ch...@gmail.com> on 2017/05/13 04:23:52 UTC

How to modify the mx ColorPicker SwatchPanel swatchPreview skin

The mx ColorPicker swatchPreview skin is created by SwatchSkin.updateSkin
function in lines 144-145.

I need to change the border color and the shadow colors as are both
hardcoded (0x999999 and 0xFFFFFF respectively) but because the design and
hierarchy of the classes of ColorPicker the preview swatch is a private
variable of type mx.skins.halo.SwatchSkin in the SwatchPanel class.

I'm only now starting to explore skinning mx components of an existing
project which has a theme class defined for it.

I'm not sure how to get the SwatchPanel class to use my SwatchSkin class
and I haven't found any examples of how to do this.

Can I get some help on this please?

Re: How to modify the mx ColorPicker SwatchPanel swatchPreview skin

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Have you considered just monkey-patching SwatchSkin?

Otherwise, I think in theory you can subclass ColorPicker, override the
mx_internal getDropDown and return a subclass of SwatchPanel that creates
subclasses of SwatchSkin.

HTH,
-Alex

On 5/12/17, 9:23 PM, "Chris Velevitch" <ch...@gmail.com> wrote:

>The mx ColorPicker swatchPreview skin is created by SwatchSkin.updateSkin
>function in lines 144-145.
>
>I need to change the border color and the shadow colors as are both
>hardcoded (0x999999 and 0xFFFFFF respectively) but because the design and
>hierarchy of the classes of ColorPicker the preview swatch is a private
>variable of type mx.skins.halo.SwatchSkin in the SwatchPanel class.
>
>I'm only now starting to explore skinning mx components of an existing
>project which has a theme class defined for it.
>
>I'm not sure how to get the SwatchPanel class to use my SwatchSkin class
>and I haven't found any examples of how to do this.
>
>Can I get some help on this please?