块块块
一个为Ethereum地址生成标识的小型图书馆。 这些不是用来取代用户配置,而是作为安全图标,让用户更容易地检查他想要互动的地址是否是正确的地址. 图标的对称性让我们的大脑看到了 面相或对象,使图标更容易识别。 这还包含HQQ库,用于可选地创建非如此堵塞的图标(见下文样本).

使用
var icon = blockies.create({
// 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.
});
document.body.appendChild(icon); // icon is a canvas element
在上述例子中,图标为15x15个块,每个块为3x3像素. 图标画布会是45x45像素.
页:1
大小8和分级4的默认生成了32x32像素图标. 下面是一些标准尺寸,效果很好。 一个大于10的大小会开始产生更多不重现的吵闹的图标.
- 24x24 (英语)
{size: 8, scale: 3} - 50x50 (英语)
{size: 5, scale: 10}
构建
node build
这一切都是微调 blockies.js 改为 blockies.min.js。 。 。 .