{"_id":"@basementuniverse/marble-identicons","_rev":"3-3d7269aaabe55bc4e4e9b13b68286893","name":"@basementuniverse/marble-identicons","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@basementuniverse/marble-identicons","version":"0.1.0","description":"Generate marble-style identicons","main":"build/identicon.js","types":"build/index.d.ts","scripts":{"build":"webpack"},"keywords":[],"author":{"name":"Gordon Larrigan","email":"gordonlarrigan@gmail.com","url":"https://gordonlarrigan.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/basementuniverse/marble-identicons.git"},"devDependencies":{"@types/randomcolor":"^0.5.6","@types/seed-random":"^2.2.1","ts-loader":"^9.2.5","typescript":"^4.3.2","webpack":"^5.51.0","webpack-cli":"^4.8.0"},"dependencies":{"@basementuniverse/commonjs":"^1.2.10","seed-random":"^2.2.0"},"gitHead":"4696bd30f635f5fa05cb11d874493245c99b88e3","bugs":{"url":"https://github.com/basementuniverse/marble-identicons/issues"},"homepage":"https://github.com/basementuniverse/marble-identicons#readme","_id":"@basementuniverse/marble-identicons@0.1.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-U/ajlKh8AjooDLNRSScjtRxVzMNI3XYtbXjSkofQUGrDsiFGQsVqRbOQec1bbxg4ZNjlD55EBZl9pzw0X0YuNA==","shasum":"a582338d4d048e77a0c2cc970c6bfe3e463ab2a2","tarball":"https://registry.npmjs.org/@basementuniverse/marble-identicons/-/marble-identicons-0.1.0.tgz","fileCount":15,"unpackedSize":392661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHvZgCRA9TVsSAnZWagAAK1wP/0taNqSko3+aPmllOnjc\ntYS1ya+sHr5GutY73L5QFQivI3bjGnGDnuCt5P02kNfWYMCiGnoRz7n5774W\nfdRiPloxckdIe6Pe3btyIjlkZlsnVDZCVfJgD2SnA0VA+Y7aJIA8IU5nnWzr\nsdBa4hRh35SSgjXbzJtRcAXeiRxrbtW6oFkJ0X9Huymyb+4qkniaGOlqaAb6\n8jVTkHl9w1abJ/+6B1tsVDvziuoALTRHBMACWnxbm0S+xkMg/1Fw4tHenku4\nIU/6+3LjySHt1feu46h3hOrF6R0bXdmxVSlqO/k+V6ivS9BMNSwAQd8WfAhx\niWzqa6WSgWJ40NwunfYGr9zB6lhSNaVsHAIituXC4Mq1M+JOSys3YRHMchs6\neXdbihRYKZqMbZqsuP6zLcGLkQsjAXwAkbUnCF8iaYCSwmZTbdtGJ81/sncy\n7UY8ZE4+NJZeaurhEzCXUW9lQfmQuMws8M9VpcxtLbfmwEB3ylD/oKjObbco\nR4QfLRML71wyNe7+EqYUDOVPTXPUXjvl/UI5El9m864sPB4OLEhlS4y8zeFH\n3uRSdQ68X88MvKi2xzSSxJHfFsNpJY0o3Eu5MjHezYQSvRg757rZN2Q0ia/f\ncxlIRBRe9n9LOKn5OVnmWeivCls80uqP7+ehy2RYsf4Hf/cDocSlypZdmWkr\nvM60\r\n=EIPq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3NbTn6aaMv4UfGFK1H/W25GsDANS4n7nkkQQ5StfRKQIgfUG+nEtiirSXqWGNvNwlwKvIp4zJY5w6pDIKnRjeyoQ="}]},"_npmUser":{"name":"basementuniverse","email":"gordonlarrigan@gmail.com"},"directories":{},"maintainers":[{"name":"basementuniverse","email":"gordonlarrigan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/marble-identicons_0.1.0_1629419104092_0.447821456606323"},"_hasShrinkwrap":false},"0.1.1":{"name":"@basementuniverse/marble-identicons","version":"0.1.1","description":"Generate marble-style identicons","main":"build/identicon.js","types":"build/index.d.ts","scripts":{"build":"webpack"},"keywords":[],"author":{"name":"Gordon Larrigan","email":"gordonlarrigan@gmail.com","url":"https://gordonlarrigan.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/basementuniverse/marble-identicons.git"},"devDependencies":{"@types/randomcolor":"^0.5.6","@types/seed-random":"^2.2.1","ts-loader":"^9.2.5","typescript":"^4.3.2","webpack":"^5.51.0","webpack-cli":"^4.8.0"},"dependencies":{"@basementuniverse/commonjs":"^1.2.10","seed-random":"^2.2.0"},"gitHead":"e4c2bb6a94707f93fcb18ea1b98b37a8c88d6658","bugs":{"url":"https://github.com/basementuniverse/marble-identicons/issues"},"homepage":"https://github.com/basementuniverse/marble-identicons#readme","_id":"@basementuniverse/marble-identicons@0.1.1","_nodeVersion":"16.7.0","_npmVersion":"7.20.3","dist":{"integrity":"sha512-T0Y08xpQe1mhoGSOenMAKkgYTTAWVefvcADlKyOabDH5f6xTIiBPj600P43Lshogav8yevokwfnkYXzX9jGebA==","shasum":"a230a3cbe926729a65d3d21038d4a35e0bbabb41","tarball":"https://registry.npmjs.org/@basementuniverse/marble-identicons/-/marble-identicons-0.1.1.tgz","fileCount":15,"unpackedSize":392868,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiI/uNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoc8w/8Ca63yYn+A0VYD3gh/ogqqhP6Rhr73oGAAYhqW/5mAK7rLW9Y\r\nLJJzfMwObOah/6HMxUbdaADgXdTASB/vP1fNmZSIt3nZcPcMVUk4B4viNgvu\r\n2bCg1hSzSsdw1SX9P/Umkc8dy1HY/H5zL0aBCqny6NNe025cEidRzMPRXddw\r\nxi4sgE5tHjzhWuVrOLFZW+L+1JV0LABykVVEfjZnUl2B16a0VtrS4cGO8jiC\r\nk+OklHdmHgqxfk9I647hQUdxlCwaWd8RPsW9PyMvv/j3oEAcon6XNYYsdkNS\r\no6ot4QpS1SQ1wPd8gfQvOnl5lEMF2VuCGVx/vBfF59jf9ulPxieiuENZ7kM2\r\nZrBkzaz4cmV3EenwrM6UD+XPoH+BRBZpT2GemXejcLO4M9mgP6cWAZHuW7QB\r\n1JWcO47m9DnLGCGWHqvFj7SPaGsjb+OjOjdFpp2S5nhVsVzNxEEOfyis8uD3\r\n6EHITiAoy5hbDvnbGKR5VIdYDbJw/NkTDJnVusNOmtXb7JRYD4fDdgV+xajJ\r\nNgKLezbNhT+JjksgjkAe4Nb6QZ0vd8adrXu1HK1VK+ly+8moYIzR1pWWfZZT\r\nQbZSL6K6RckozVJr09h7hjqUompd+iALIbaKYAkZ7LQNiut+BJ/SWisOA+4w\r\nn6xfpkysFG+ydyVMrdFVado3kKYIt2ObnZg=\r\n=ywGE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICHnqxK6Ib4OVAMjtmO7F+a23ELMIZVVFXIuQTr6966nAiEAscAzKU7+5J+DtbigYqyhdNfBEtAREVWtRdlUr034cj0="}]},"_npmUser":{"name":"basementuniverse","email":"gordonlarrigan@gmail.com"},"directories":{},"maintainers":[{"name":"basementuniverse","email":"gordonlarrigan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/marble-identicons_0.1.1_1646525325545_0.879093850699527"},"_hasShrinkwrap":false},"0.1.2":{"name":"@basementuniverse/marble-identicons","version":"0.1.2","description":"Generate marble-style identicons","main":"build/identicon.js","types":"build/index.d.ts","scripts":{"build":"webpack"},"keywords":[],"author":{"name":"Gordon Larrigan","email":"gordonlarrigan@gmail.com","url":"https://gordonlarrigan.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/basementuniverse/marble-identicons.git"},"devDependencies":{"@types/randomcolor":"^0.5.6","@types/seed-random":"^2.2.1","ts-loader":"^9.2.5","typescript":"^4.3.2","webpack":"^5.51.0","webpack-cli":"^4.8.0"},"dependencies":{"@basementuniverse/commonjs":"^1.2.10","seed-random":"^2.2.0"},"gitHead":"11c10b90bdeda88ae3f14024508cfce31f6de54f","bugs":{"url":"https://github.com/basementuniverse/marble-identicons/issues"},"homepage":"https://github.com/basementuniverse/marble-identicons#readme","_id":"@basementuniverse/marble-identicons@0.1.2","_nodeVersion":"16.7.0","_npmVersion":"7.20.3","dist":{"integrity":"sha512-Z9w8lp4hwy3zwtl+ldVtN+Vr9BkD/NJCJZWLDjiWYLIkMPglhqUDy8ffXNDAB35UmKj7p/X+LKtSr+ApbMYhLA==","shasum":"c4476a2c432c0c97b6c42c02916e8affa23b3077","tarball":"https://registry.npmjs.org/@basementuniverse/marble-identicons/-/marble-identicons-0.1.2.tgz","fileCount":6,"unpackedSize":238261,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDM7Fy+vVwat/v4gH9dt022Iz/7sHjCkpIkhuda5eUHAAIhAN2MUHrNZ4SwwNVr5yrXiKoXfmi7dOHjRv0xUkMWvt3m"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiV+Y5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNCQ/9EdzJBPKkbiQJdxzaYVR4p/c+EZjA+EgonGwwMR08E8GUUypA\r\nOY+vPZzjsFoSFH5rOyro9Q7yP+mnDyURzM58JUBqqSnwJazWTEC7HETsYcO1\r\n/PQbruEII14tZg2UifG8zu9uokggv8nhvPQaI8wLqibuEJZOYqbOESHdtYHI\r\neinhg/hYICsf1RjM5wAK083uPd52Q1EnjpYEhAefHyiWoi2Crj1ga33ErHSv\r\nDrnUMc6O/JBVARhAxeH/cxfj7cmBpcCKzZvRHkiugVnY+nihq6s1S0A4rBEF\r\nVK6G+YTbvGpeGUsLGBkcexDjJVc7U7qolYJOxG5V0FYVXfIRm5lNx2MDxp22\r\nIKmaEUURT7wGQEqHAj6WDYW6ETj9ne1nY8yiqsm8izUFQ4ZqYgijp0vH9DdD\r\ntv1UY+22evCSwaTAt/o2Ga+Kd1wR4FE6c4I7OW0keRa1qnMZ6DVNMnxoZ9oH\r\nRdCle2R/EZyMdux2E7KDwjJsKcN8jEhXCDoK4G2VmtmpAmr1e0xdWzNbonVU\r\nZ3KqSqPgjHQ4ZxJYnLBXHRWcHrz+cbYHpsqe34AOamAb4mj8jA4ND2wooCAq\r\n/fM2gPJvpZCrPoYTNHcrCTbxnaWOEK7eiocuCskEBbsEygqpJTA3rruhhkFr\r\nh6WzgzWOp/gcu96I9MzYm1ntBQAInqTK4mQ=\r\n=LW78\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"basementuniverse","email":"gordonlarrigan@gmail.com"},"directories":{},"maintainers":[{"name":"basementuniverse","email":"gordonlarrigan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/marble-identicons_0.1.2_1649927736982_0.777279242348385"},"_hasShrinkwrap":false}},"time":{"created":"2021-08-20T00:25:04.050Z","0.1.0":"2021-08-20T00:25:04.316Z","modified":"2022-04-14T09:15:37.260Z","0.1.1":"2022-03-06T00:08:45.763Z","0.1.2":"2022-04-14T09:15:37.182Z"},"maintainers":[{"name":"basementuniverse","email":"gordonlarrigan@gmail.com"}],"description":"Generate marble-style identicons","homepage":"https://github.com/basementuniverse/marble-identicons#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/basementuniverse/marble-identicons.git"},"author":{"name":"Gordon Larrigan","email":"gordonlarrigan@gmail.com","url":"https://gordonlarrigan.com"},"bugs":{"url":"https://github.com/basementuniverse/marble-identicons/issues"},"license":"MIT","readme":"# Marble Identicons\n\nGenerate random marble-style identicons.\n\n![Identicons Preview](preview.png)\n\n## Installation\n\n```\nnpm install @basementuniverse/marble-identicons\n```\n\n## Usage\n\nAPI:\n```js\nfunction identicon(\n  name: string,\n  settings: Partial<IdenticonSettings>\n) => HTMLCanvasElement\n```\n\nSee [below](#settings) for more information on configuration settings.\n\n### In a browser environment\n\nInclude the script in your page and call the `identicon` function. It will return a\n`HTMLCanvasElement` node which can be appended to the DOM or drawn into another canvas.\n\nExample:\n```html\n<script src=\"build/identicon.js\"></script>\n<script>\n\nconst myIdenticon = identicon('Alan Turing');\n\ndocument.body.appendChild(myIdenticon);\n\n</script>\n```\n\n### In React\n\nThis example shows one way of wrapping the `HTMLCanvasElement` inside a JSX element:\n```tsx\nimport { useRef, useLayoutEffect } from 'react';\nimport { identicon } from '@basementuniverse/marble-identicons';\n\nexport function MarbleIdenticon({ name }: { name: string }) {\n  const ref = useRef<HTMLDivElement>(null);\n\n  useLayoutEffect(() => {\n    if (ref.current) {\n      ref.current.innerHTML = '';\n      ref.current.appendChild(identicon(name));\n    }\n  });\n\n  return (\n    <div className=\"identicon\" ref={ref}></div>\n  );\n}\n```\n\nThis component can then be used like so:\n```tsx\nReactDOM.render(\n  <MarbleIdenticon name=\"Alan Turing\" />,\n  document.getElementById('root')\n);\n```\n\n## Settings\n\n```ts\ntype IdenticonSettings = {\n  size: number;\n  baseSeed: string;\n  font: string;\n  fontStyle: FontStyle;\n  fontSize: number;\n  backgroundColours: string[];\n  initialsColours: string[];\n  initialsOffset: vec;\n  initialsAlpha: number;\n  initialsCompositeOperation: CompositeOperation;\n  stripeColours: string[];\n  stripeAlpha: number;\n  stripeCompositeOperation: CompositeOperation;\n  stripes: [number, number];\n  stripeWidth: [number, number];\n  stripeDeviation: [number, number];\n  curveAmount: [number, number];\n  curveOffset: [number, number];\n  startWidthSign: WidthSign[];\n  endWidthSign: WidthSign[];\n};\n```\n\n| Setting                      | Type                 | Description                                                                                                                                                                                                                        | Default value                                                                                         |\n|------------------------------|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|\n| `size`                       | `number`             | The size of the identicon in pixels                                                                                                                                                                                                | `100`                                                                                                 |\n| `baseSeed`                   | `string`             | A string that will be prefixed onto the name when seeding the RNG                                                                                                                                                                  | `''`                                                                                                  |\n| `font`                       | `string`             | The font family used for the initials                                                                                                                                                                                              | `'Helvetica'`                                                                                         |\n| `fontStyle`                  | `FontStyle`          | The font style used for the initials. Must be one of `''`, `'normal'`, `'bold'`, `'italic'`                                                                                                                                        | `'bold'`                                                                                              |\n| `fontSize`                   | `number`             | The font size used for the initials, as a factor of `size`                                                                                                                                                                         | `0.4`                                                                                                 |\n| `backgroundColours`          | `string[]`           | An array of background colours. One will be picked at random from this list.                                                                                                                                                       | `['#16a085', '#1abc9c', '#2ecc71', '#3498db', '#1970b9', '#9b59b6', '#e67e22', '#e74c3c', '#e0395b']` |\n| `initialsColours`            | `string[]`           | An array of colours used for the initials. The index of the randomly-chosen background colour will be used to select from this list, clamped to the size of the array.                                                             | `['#ffffff']`                                                                                         |\n| `initialsOffset`             | `vec`                | The initials offset position. `{ x: number, y: number }`                                                                                                                                                                           | `{ x: 0, y: 0 }`                                                                                      |\n| `initialsAlpha`              | `number`             | The alpha opacity of the initials                                                                                                                                                                                                  | `1`                                                                                                   |\n| `initialsCompositeOperation` | `CompositeOperation` | The global composite operation used for the initials. Must be one of `'source-over'`, `'lighter'`, `'multiply'`, `'screen'`, `'overlay'`, `'color-dodge'`, `'color-burn'`, `'hard-light'`, `'soft-light'`                          | `'source-over'`                                                                                       |\n| `stripeColours`              | `string[]`           | An array of colours used for the stripes. The index of the randomly-chosen background colour will be used to select from this list, clamped to the size of the array.                                                              | `['#f1c40f']`                                                                                         |\n| `stripeAlpha`                | `number`             | The alpha opacity of the stripes                                                                                                                                                                                                   | `0.15`                                                                                                |\n| `stripeCompositeOperation`   | `CompositeOperation` | The global composite operation used for the stripes. Must be one of `'source-over'`, `'lighter'`, `'multiply'`, `'screen'`, `'overlay'`, `'color-dodge'`, `'color-burn'`, `'hard-light'`, `'soft-light'`                           | `'lighter'`                                                                                           |\n| `stripes`                    | `[number, number]`   | A tuple containing the minimum and maximum number of stripes to draw                                                                                                                                                               | `[3, 8]`                                                                                              |\n| `stripeWidth`                | `[number, number]`   | A tuple containing the minimum and maximum stripe width, measured in radians.                                                                                                                                                      | `[0.2, 0.7]`                                                                                          |\n| `stripeDeviation`            | `[number, number]`   | A tuple containing minimum and maximum distances between successive stripes, measured in radians.                                                                                                                                  | `[-0.5, 0.5]`                                                                                         |\n| `curveAmount`                | `[number, number]`   | A tuple containing the minimum and maximum radius multiplier for the control point circle.                                                                                                                                         | `[0.2, 0.4]`                                                                                          |\n| `curveOffset`                | `[number, number]`   | A tuple containing the minimum and maximum offset angle for the control point measured in radians.                                                                                                                                 | `[0, 0.5]`                                                                                            |\n| `startWidthSign`             | `WidthSign[]`        | An array of signs (`'positive'` or `'negative'`) for the starting edge of each stripe. If `startWidthSign` is `['positive']` and `endWidthSign` is `['negative']` (or vice-versa) then the stripe side edges will not cross over.  | `['positive', 'negative']`                                                                            |\n| `endWidthSign`               | `WidthSign[]`        | An array of signs (`'positive'` or `'negative'`) for the ending edge of each stripe.                                                                                                                                               | `['positive', 'negative']`                                                                            |\n","readmeFilename":"README.md"}