I was looking at the code I had written and the cairo commands to draw the flower shapes clearly had repeating patterns, so I decided to use the old "for i =" trick to make the code smaller. This worked and I managed to cut down the line count quite considerably. Then I realized that having done that I could change the range that i is equal to. The end result is that you can now specify the number of petals for each flower, and the bumpy middle always has 2x the number of petals.
Conky flowers revisited.
Go here to the crunchbang forum for the latest code.
UPDATE - I have updated the code in the post above so that the Lua script has my improved circlewriting function.
UPDATE2 - I wasn't completely happy with the circular middles, they seemed too hard. So I have enabled the option to draw bumpy middles as so:
Some significant changes and some significant improvements.
First the improvements:
- flower are placeable independently
- flowers can be rotated in place without anything else being effected
- flowers can be used with any wallpaper and allow transparency effects and overlap
The third improvement was accomplished by redesigning the flower's color change mechanism. In the original the flower color change "effect" was created by placing a circle that changed size in response to a numerical input behind a flower "cutout" (see my crunchbang post to see what I'm talking about). But with the revisit, each petal moves independently from each other (except they are all fed the same number although it would be possible to have each petal represent a separate data output). Everything is contained within the flower shape.
There are some things I need to work on. The circlewriting function needs work. I think I know how to get it working better, but right now it is far too fiddly, adjusting the "variables" to make everything look right.
Anyway, this is yet another (or an alternative) entry in the conky blog valentine competition.