用于创建头像的 jQuery/JavaScript 库?
有人知道可以创建 Pixelart 头像的 JavaScript 或 jQuery 库吗?我希望使用组件创建具有 Mr. Potatohead 风格的面孔并生成 GIF.
Is anyone aware of a JavaScript or jQuery library that enables the creation of Pixelart avatars? I'm hoping for something with a Mr. Potatohead style face creation using components and resulting in a GIF.
如果没有,我想我需要自己制作一个.
If not, I guess I'll need to make one myself.
推荐答案
你可以试试Blockies.
它的使用非常简单(来自 README):
Its usage is pretty simple (from the README):
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: white
size: 15, // width/height of the icon in blocks, default: 10
scale: 3 // width/height of each block in pixels, default: 5
});
其中 icon
是一个画布元素.
where icon
is a canvas element.
但是,您无法真正计划要获得什么:您最终会得到一个随机图标,除非您指定生成它的种子.
You can't really plan what you're going to get, though: you just end up with a random icon unless you specify a seed to generate it from.
相关文章