{"_id":"@apollo-tech/random-color","_rev":"3-1626d8eab1a27ef9eeec5b18d671f01a","name":"@apollo-tech/random-color","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@apollo-tech/random-color","version":"0.0.1","keywords":["random","color","generator","typescript"],"author":{"name":"Steven Hall"},"license":"CC0","_id":"@apollo-tech/random-color@0.0.1","maintainers":[{"name":"steven-t-h","email":"shall1313@gmail.com"}],"dist":{"shasum":"4fbba499f12c6d6588200eb8f48114ce583516fb","tarball":"https://registry.npmjs.org/@apollo-tech/random-color/-/random-color-0.0.1.tgz","fileCount":8,"integrity":"sha512-dSjhxcXrgTdTDxISo7lKDuK9A+RZ9oYTso8pWf8zjL5tL3UJrPE9+mgKc3jjmNvy/WvJVaXXTEU0qMcjB9fmFg==","signatures":[{"sig":"MEQCIEJTSqVsA7/KRITpO1zLehYyMtQGgdAXZdhfky9sz0ICAiAb7M5cL9Gz4FX3pwOvzH+NgzuM64+rZufWLL0GixsWuA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93265},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","scripts":{"test":"jest","build":"tsup","test:cov":"jest --coverage"},"_npmUser":{"name":"steven-t-h","email":"shall1313@gmail.com"},"_npmVersion":"10.2.4","description":"A simple random color generator","directories":{},"_nodeVersion":"18.19.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.3.0","ts-jest":"^29.2.5","typescript":"^5.6.2","@types/jest":"^29.5.13","@types/node":"^22.7.4"},"_npmOperationalInternal":{"tmp":"tmp/random-color_0.0.1_1727939553477_0.1120896157086051","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@apollo-tech/random-color","version":"0.0.2","keywords":["random","color","generator","typescript"],"author":{"name":"Steven Hall"},"license":"CC0","_id":"@apollo-tech/random-color@0.0.2","maintainers":[{"name":"steven-t-h","email":"shall1313@gmail.com"}],"dist":{"shasum":"e569b97438e8740b5009d06cf6d82c63b75cf1bf","tarball":"https://registry.npmjs.org/@apollo-tech/random-color/-/random-color-0.0.2.tgz","fileCount":8,"integrity":"sha512-R3jnh7vRv15UQar0a572fgpWukbSN65J1sww5GDWIwEDFPouvECWDh/Y2suDPH5XxDn/JtlxraQZxDRo1T5b/A==","signatures":[{"sig":"MEYCIQDRwMX6HfT0uP7HV9NOu+xs3KOBtQf7+VRaR+C0/5XN+QIhAPwWEGwvNclQpD+xWvVSYEaU52gA+OQFFGxsA7GPoYvU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102568},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","scripts":{"test":"jest","build":"tsup","publish":"npm run build && npm publish --access public","test:cov":"jest --coverage","prepublish":"npm run build","preversion":"npm test"},"_npmUser":{"name":"steven-t-h","email":"shall1313@gmail.com"},"_npmVersion":"10.2.4","description":"A simple random color generator","directories":{},"_nodeVersion":"18.19.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.3.0","ts-jest":"^29.2.5","typescript":"^5.6.2","@types/jest":"^29.5.13","@types/node":"^22.7.4"},"_npmOperationalInternal":{"tmp":"tmp/random-color_0.0.2_1727940865825_0.5650705537612171","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@apollo-tech/random-color","version":"0.0.3","keywords":["random","color","generator","typescript"],"author":{"name":"Steven Hall"},"license":"CC0","_id":"@apollo-tech/random-color@0.0.3","maintainers":[{"name":"steven-t-h","email":"shall1313@gmail.com"}],"dist":{"shasum":"eb266c7d915625b9532257c2eb2f2df4c4c2a824","tarball":"https://registry.npmjs.org/@apollo-tech/random-color/-/random-color-0.0.3.tgz","fileCount":9,"integrity":"sha512-D+FFr7c+ql2OFlxNZP/0DJmsgSkS9uCyWGzfN+nwAa32qb5ezyEMkpx+t/C2R1kxKqDeczhmGZa78o9eZanWUg==","signatures":[{"sig":"MEQCIH+QX/5mhKaP/smbPp94E0bAImXv9pK1T90vl8UiRYjnAiAnSIPAT0D8w/ebVcjJnCfLn7/fQ/wip2yJ1dC/R4b5pw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":109748},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"2887593a8498b570579f348900bfa6dcdadde369","scripts":{"test":"jest","build":"tsup","publish":"npm run build && npm publish --access public","test:cov":"jest --coverage","prepublish":"npm run build","preversion":"npm test"},"_npmUser":{"name":"steven-t-h","email":"shall1313@gmail.com"},"_npmVersion":"10.2.4","description":"A simple random color generator","directories":{},"_nodeVersion":"18.19.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.3.0","ts-jest":"^29.2.5","typescript":"^5.6.2","@types/jest":"^29.5.13","@types/node":"^22.7.4"},"_npmOperationalInternal":{"tmp":"tmp/random-color_0.0.3_1728115889794_0.9426796017920711","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@apollo-tech/random-color","repository":{"type":"git","url":"git+https://github.com/steven-t-h/random-color-generator.git"},"version":"0.0.4","private":false,"description":"A simple random color generator","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"test":"jest","test:cov":"jest --coverage","build":"tsup","prepublish":"npm run build","preversion":"npm test","deploy":"npm run build && npm publish --access public"},"keywords":["random","color","generator","typescript"],"author":{"name":"Steven Hall"},"license":"CC0","devDependencies":{"@types/jest":"^29.5.13","@types/node":"^22.7.4","jest":"^29.7.0","ts-jest":"^29.2.5","tsup":"^8.3.0","typescript":"^5.6.2"},"_id":"@apollo-tech/random-color@0.0.4","gitHead":"5581ceeda5066a19c1c099eac6011b5a2a96d026","bugs":{"url":"https://github.com/steven-t-h/random-color-generator/issues"},"homepage":"https://github.com/steven-t-h/random-color-generator#readme","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-fVra4ff5AD3uzWiLiQThaWKeqfSjcBX5eUrQwloDAhimaWttkxZJFVKP5ssfqKh8/A0b3XvlRDdrYOVxtbSOzg==","shasum":"b497d3f35f3f4911c74c85a9c60438300dceed12","tarball":"https://registry.npmjs.org/@apollo-tech/random-color/-/random-color-0.0.4.tgz","fileCount":9,"unpackedSize":113529,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgIIWPoq+G8KYA1kzxHHhPzcvxH/scqjEkgo+uyoTIOQIhANHX24iMcaE5EQnNWXKMfjRRsW/TKDVtl0JQ29m/kq6a"}]},"_npmUser":{"name":"steven-t-h","email":"shall1313@gmail.com"},"directories":{},"maintainers":[{"name":"steven-t-h","email":"shall1313@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/random-color_0.0.4_1728116148454_0.5443528767047594"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-03T07:12:33.390Z","modified":"2024-10-05T08:15:48.885Z","0.0.1":"2024-10-03T07:12:33.710Z","0.0.2":"2024-10-03T07:34:26.002Z","0.0.3":"2024-10-05T08:11:29.993Z","0.0.4":"2024-10-05T08:15:48.661Z"},"author":{"name":"Steven Hall"},"license":"CC0","keywords":["random","color","generator","typescript"],"description":"A simple random color generator","maintainers":[{"name":"steven-t-h","email":"shall1313@gmail.com"}],"readme":"# Random Color Generator\n\nThis is a simple random color generator that generates a random color, or colors, in the requested format. It is heavily\nbased on the [randomcolor](https://github.com/davidmerfield/randomColor) tiny script. This package simply expands\non the original script by adding more features and options, particularly by instantiating a class that can be used to\nretain the history of generated colors.\n\n## Installation\n\n```bash\nnpm install @apollo-tech/random-color\n```\n\n## Usage\n\n### Basic Usage\n```javascript\nimport RandomColorGenerator from '@apollo-tech/random-color';\n// create a new instance of the random color generator\nconst generator = new RandomColorGenerator();\n// generate a random color\nconst color = generator.randomColor()\nconsole.log(color);\n// Output: '#a3e2c1'\n```\n\n### Options\n\nYou can pass an options object to influence the type of color it produces. The options object accepts the following properties:\n\n`hue` – Controls the hue of the generated color. You can pass a string representing a color name: `red`, `orange`, `yellow`, \n`green`, `blue`, `purple`, `pink` and `monochrome` are currently supported.\n\n`luminosity` – Controls the luminosity of the generated color. You can specify a string containing `bright`, `light` or `dark`.\n\n`count` – An integer which specifies the number of colors to generate.\n\n`seed` - An integer or string which when passed will cause randomColor to return the same color each time.\n\n`format` – A string which specifies the format of the generated color. Possible values are `rgb`, `rgba`, `rgbArray`, `hsl`, `hsla`, `hslArray`, and `hex`.\nIf you do not provide a value, `hex` will be used.\n\n`alpha` – A decimal between 0 and 1. This is only relevant when using a format with an alpha channel (`rgba` and `hsla`). Defaults to a random value.\n\n```javascript\n// generate a random color in a specific format\nconst color = generator.randomColor({ format: 'rgb' });\nconsole.log(color);\n// Output: 'rgb(225,200,20)'\n```\n\n### History\n\nThe generator class retains a history of generated colors. You can access the history by calling the `history` property.\n\n```javascript\n// view the history of generated colors\nconsole.log(generator.history);\n// Output: ['#a3e2c1', 'rgb(225,200,20)']\n```\n\n### Methods\n\n\n#### Verbose Logging\nYou can enable a logging method by setting the verbose mode to true. This will log the generated color to the console.\nAll console messages are logged using the `console.debug` method and are prefixed with the string `[RandomColor]`.\n\n```javascript\n// enable verbose mode for testing\ngenerator.setVerbose(true);\nconsole.log(generator.verbose)\n// Output: true\n```\n\n#### Set Seed\n\nYou can set the seed for the random color generator. This will allow you to generate the same random color each time\nyou run the generator with the same seed. The seed can be set in the options object when calling the `randomColor` method,\nor by calling the `setSeed` method.\n\n```javascript\n// change the seed\ngenerator.setSeed(1234);\nconsole.log(generator.seed);\n// Output: 1234\n```\n\n","readmeFilename":"README.md","homepage":"https://github.com/steven-t-h/random-color-generator#readme","repository":{"type":"git","url":"git+https://github.com/steven-t-h/random-color-generator.git"},"bugs":{"url":"https://github.com/steven-t-h/random-color-generator/issues"}}