Read my book

I wrote books about Webpack and React. Check them out!

Sunday, March 21, 2010

Harmony - New Experimental Features, Mirroring, Constraints etc.

I mentioned about Harmony in an earlier post. Harmony is HTML5 Canvas based sketching application. It's extremely light and doesn't have much bloat, yet. ;)

I glanced at the code about a week ago as I had a couple of ideas I wanted to implement. The problem was that it was formatted badly and contained some extra code that needed to be gotten rid of. Fortunately rhyolight managed to do this. In the process he added a couple of new brushes to Harmony. You can find more information about those at his blog post.

With source code available I was inspired to hack around a bit. I ended up implementing following features:
  • mirroring (x, y, radial)
  • "sticky" palette (shift). Note that it's not possible to paint under the palette!
  • vertical constraint (hit s while painting)
  • horizontal constraint (hit a while painting)
  • perspective constraint (hit d while painting, set target with f)
Constraits mimic the perspective system implemented in "Digital Painter" except that it's only 1D. :) It probably would be a good idea to add support for more targets and a way to cycle between them but that's for some later time.

Note that mirroring has been implemented so that it's possible to use multiple mirrors at once. Give it a go.

rhyolight appears to host quite a recent version here. It's missing undo but otherwise it should be ok. You can find a version with an early implementation of undo at my development branch. It might be cool to make it a bit faster and add playback.

Feedback on the features and ideas are welcome as always of course.