Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/naknomum/solacon

An SVG-based identicon visual hash, generated via internal javascript.
https://github.com/naknomum/solacon

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# solacon

A *solacon* is a variation of an [identicon](https://en.wikipedia.org/wiki/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](Solacon.svg.png "Solacon.svg")

## Example

Try out some [dynamical examples](https://naknomum.github.io/solacon-example/) of **solacons** in action.

## Usage

```javascript

// 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

- [Kotlin Android port](https://github.com/phazei/solacon-kotlin) of solacon by phazei
- Another identicon project of mine, [Hexicon.js](https://github.com/naknomum/hexicon).
- For related work, check out [Awesome Identicons](https://github.com/drhus/awesome-identicons), a curated list of _visual hashes_ maintained by **Husam ABBOUD**.