How to use the jdenticon.config 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 HaliteChallenge / Halite-III / website / javascript / api.js View on Github external
export function fallbackAvatar(username) {
  // Custom identicon style
  // https://jdenticon.com/icon-designer.html?config=ffffffff01416400154b194b
  jdenticon.config = {
    lightness: {
      color: [0.21, 0.75],
      grayscale: [0.26, 0.75],
    },
    saturation: {
      color: 1.00,
      grayscale: 0.00,
    },
    backColor: "#ffffffff",
  }

  const identicon = window.encodeURIComponent(jdenticon.toSvg(md5(username), 100))
  return `data:image/svg+xml;utf8,${identicon}`
}
github DiceBear / avatars / packages / avatars-jdenticon-sprites / src / index.ts View on Github external
return function(random: Random) {
    jdenticon.config = {
      hues: options.hues,
      lightness: {
        color: options.colorLightness,
        grayscale: options.grayscaleLightness
      },
      saturation: {
        color: options.colorSaturation,
        grayscale: options.grayscaleSaturation
      },
      backColor: options.background
    };

    return jdenticon
      .toSvg(random.seed, 50, options.padding || 0)
      .replace('width="50"', '')
      .replace('height="50"', '');