emeraldpay / hashicon

Generates a beautiful representation of any hash.
Apache License 2.0
191 stars 22 forks source link

Support optional createCanvas factory #25

Closed justinmchase closed 5 years ago

justinmchase commented 5 years ago

This adds no additional dependencies and doesn't break anything but instead adds an optional createCanvas factory function on the params which a caller can use to inject their own canvas.

I plan to implement a hashicon-cli library which will inject the node-canvas in to enable server side image rendering.

CLAassistant commented 5 years ago

CLA assistant check
All committers have signed the CLA.

justinmchase commented 5 years ago

I believe this addresses the concerns in #24 while enabling the core features of the branch.

splix commented 5 years ago

thank you!

oori commented 5 years ago

@justinmchase Thanks. Originally I thought it'd be better to allow bypassing the createCanvas() completely, so one will not go through our HiDPR scaling, or allow other modifications on the canvas on creation. But, honestly I don't see any real-world requirement, so I'm cool with your solution. Thanks.
Could you please just update the README as well (params and node-canvas example sections).

justinmchase commented 5 years ago

Ok will do.