Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

naknomum/solacon

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
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

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.