Github's identicons like generator in javascript using canvas