Skip to content

Commit

Permalink
1.0!
Browse files Browse the repository at this point in the history
  • Loading branch information
download13 committed Aug 12, 2018
1 parent 6d5abf4 commit 3815c2f
Show file tree
Hide file tree
Showing 20 changed files with 1,366 additions and 12,277 deletions.
Binary file removed .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
node_modules/
.DS_Store
52 changes: 35 additions & 17 deletions README.md
@@ -1,40 +1,60 @@
Blockies
========

A tiny library for generating identicons for Ethereum addresses. These are not meant to replace user profiles, but as security icons, to allow the user to more easily check if an address he wants to interact with is the correct one. The symmetrical aspect of the icons allow our brain see [faces or objects](https://en.wikipedia.org/wiki/Pareidolia), making the icon more recognizable. This also contains the HQX library, for optionally creating not-so-blocky icons (see sample below).
A tiny library for generating blocky identicons.

![Sample blockies image](sample.png "Blockies")
![Sample blockies image](examples/sample.png "Blockies")

[**Demo page**](http://download13.github.io/blockies/)

Use
Browser
---

```javascript
var icon = blockies.create({ // All options are optional
import { createIcon } from './blockies.mjs';

var icon = createIcon({ // All options are optional
seed: 'randstring', // seed used to generate icon data, default: random
color: '#dfe', // to manually specify the icon color, default: random
bgcolor: '#aaa', // choose a different background color, default: random
size: 15, // width/height of the icon in blocks, default: 8
scale: 3, // width/height of each block in pixels, default: 4
spotcolor: '#000' // each pixel has a 13% chance of being of a third color,
// default: random. Set to -1 to disable it. These "spots" create structures
// that look like eyes, mouths and noses.
bgcolor: '#aaa', // choose a different background color, default: white
size: 15, // width/height of the icon in blocks, default: 10
scale: 3 // width/height of each block in pixels, default: 5
});

document.body.appendChild(icon); // icon is a canvas element
```

In the above example the icon will be 15x15 blocks, and each block will be 3x3 pixels. The icon canvas will be 45x45 pixels.

Node
---

```javascript
import { createCanvas } from 'canvas';
import { renderIcon } from './blockies.mjs';

const canvas = createCanvas(50, 50);

var icon = renderIcon(
{ // All options are optional
seed: 'randstring', // seed used to generate icon data, default: random
color: '#dfe', // to manually specify the icon color, default: random
bgcolor: '#aaa', // choose a different background color, default: white
size: 15, // width/height of the icon in blocks, default: 10
scale: 3 // width/height of each block in pixels, default: 5
},
canvas
);
```


Notes
-----

The defaults of size 8 and scale 4 generate 32x32 pixel icons. Below are some standard sizes that work well. A size larger than 10 will start generating more noisy icons that don't ressemble much.

The defaults of size 10 and scale 5 generate 50x50 pixel icons. Below are some standard sizes that work well. A size larger than 10 will start generating more noisy icons that don't ressemble much.
* 24x24 `{size: 8, scale: 3}`
* 50x50 `{size: 5, scale: 10}`
* 32x32 `{size: 8, scale: 4}`
* 48x48 `{size: 12, scale: 4}`


Alternative Styles
Expand All @@ -46,11 +66,9 @@ Alternative Styles
Build
-----

node build
All this does is minify `blockies.js` to `blockies.min.js`.

npm run build

License
-------

[WTFPL](http://www.wtfpl.net/)
[WTFPL](http://www.wtfpl.net/)
129 changes: 0 additions & 129 deletions blockies.js

This file was deleted.

1 change: 0 additions & 1 deletion blockies.min.js

This file was deleted.

24 changes: 0 additions & 24 deletions bower.json

This file was deleted.

69 changes: 0 additions & 69 deletions build.js

This file was deleted.

1 change: 1 addition & 0 deletions dist/blockies.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 0 additions & 45 deletions ethereum-address-sample.html

This file was deleted.

0 comments on commit 3815c2f

Please sign in to comment.