Implementing createPattern

Simple implementation of ctx.createPattern()