Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/naknomum/solacon
- Owner: naknomum
- License: mit
- Created: 2021-11-25T22:01:43.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-14T02:36:27.000Z (almost 2 years ago)
- Last Synced: 2024-06-11T16:29:01.089Z (8 months ago)
- Language: HTML
- Size: 62.5 KB
- Stars: 11
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-identicons - Solacon - 2021 (Solacon)
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**.