How to modify the mx ColorPicker SwatchPanel swatchPreview skin

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to modify the mx ColorPicker SwatchPanel swatchPreview skin

Chris Velevitch
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?
Reply | Threaded
Open this post in threaded view
|

Re: How to modify the mx ColorPicker SwatchPanel swatchPreview skin

Alex Harui-2
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" <[hidden email]> 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?