Skip to content

An SVG-based identicon visual hash, generated via internal javascript.

License

Notifications You must be signed in to change notification settings

naknomum/solacon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

solacon

A solacon is a variation of an identicon, in the form of a solar/spiral/floral shape. This is also known as a "visual hash".

The solacon is seeded with a value (string) which determines the shape, symmetry, and shades of the image.

The SVG file contains all the javascript needed to generate the content, so one only needs to set attributes (e.g. data-value) on the object that is embedding the svg.

Solacon.svg

Example

Try out some dynamical examples of solacons in action.

Usage

<object type="image/svg+xml" style="width: 500px; height: 500px;" id="svg-obj"
	data="solacon.svg"
	data-value="Hello world."
	data-rgb="0, 30, 255"
></object>


// the parent document can alter the solacon
var svgObj = document.getElementById('svg-obj');
svgObj.setRGB('100, 150, 200');
svgObj.generate('some new value');
svgObj.setRGB();         // random color
svgObj.generate();       // random seed value
svgObj.setRGBFromHash(); // color is based off hashValue (default behavior)
svgObj.refresh();        // applies color change to current shape

Related

About

An SVG-based identicon visual hash, generated via internal javascript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages