# Graphics class - how to get the current shape?

**URL:** <https://forum.kirupa.com/t/graphics-class-how-to-get-the-current-shape/301445>\
**Category:** Uncategorized\
**Created:** [December 9, 2009, 1:01pm UTC](https://forum.kirupa.com/t/graphics-class-how-to-get-the-current-shape/301445 "2009-12-09T13:01:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vektorviktor\_nh](https://avatars.discourse-cdn.com/v4/letter/v/c5a1d2/32.png) [@vektorviktor\_nh](https://forum.kirupa.com/u/vektorviktor_nh)\
**Post date:** [December 9, 2009, 1:01pm UTC](https://forum.kirupa.com/t/graphics-class-how-to-get-the-current-shape/301445/1 "2009-12-09T13:01:48Z")

</div>

Hello.

My application has a lot of dynamically loaded shapes… Now i am working on an interface to change the color properties of each Sprite. The first idea was a simple colorTransform. But afaik this only allows for transforming the existing colors.  
I also want to be able to define a NEW fill, i.e. GradientType.LINEAR / RADIAL.

SOLUTION 1:  
There may be an undocumented method to retrieve a graphics current points. With that i could loop through this Array with lineTo and redraw the current shape with the new solid / gradient fill.

SOLUTION 2:  
Create a newSprite with the chosen GradientType, size it by currentSprite.getBounds(); and then use newSprite.mask = currentSprite; to fake my desired fill… However, i am afraid of the impact this creates on the application as there may be more than 200 of these Shapes displayed on stage… overlapping each other.

Please show me a way to do it… google won’t help ☹

Viktor
