How to use the jdenticon.drawIcon function in jdenticon

To help you get started, we’ve selected a few jdenticon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github petkaantonov / HTML-Music-Player / src / player / PlayerPictureManager.js View on Github external
} catch (e) {
                    // NOOP
                }
                image.blob = null;
                this._generatedImages.delete(cachedKey);
                j++;
            }
        }

        const ctx = this._jdenticonCtx;
        ctx.clearRect(0, 0, size, size);
        ctx.save();
        ctx.fillStyle = `rgba(255, 255, 255, 255)`;
        ctx.fillRect(0, 0, size, size);
        ctx.restore();
        jdenticon.drawIcon(ctx, hexString(uid), size);
        const image = await canvasToImage(this._jdenticonCanvas, this._page);
        this._generatedImages.set(key, image);
        return image;
    }