/randicon

Generate SVG icon based on string hash code.

Primary LanguageJavaScriptMIT LicenseMIT

Randicon

Randicon generates gravatar-like, slack-like icons based on the string hashcode.

Usage

Use bower:

bower install randicon

or include dist/randicon.min.js into your document:

  <!-- (1) Include randicon.min.js -->
  <script src="dist/randicon.min.js"></script>

  <svg id="icon1" width="64" height="64"/>

  <script>
    // (2) Call randicon(id, string)
    randicon("#icon1", "johnny-bravo@acme.com");
  </script>

Please note that randicon.min.js includes snap.svg.min.js.

Example

Example Output

Development

npm install
bower install
gulp

License

MIT

Credits

Shoutout to @Snapsvg guys.