{"id":13438830,"url":"https://github.com/davidmerfield/randomColor","last_synced_at":"2025-03-20T06:31:33.596Z","repository":{"id":15833841,"uuid":"18573791","full_name":"davidmerfield/randomColor","owner":"davidmerfield","description":"A tiny script for generating attractive colors","archived":false,"fork":false,"pushed_at":"2024-02-08T08:25:12.000Z","size":5151,"stargazers_count":6103,"open_issues_count":18,"forks_count":407,"subscribers_count":80,"default_branch":"master","last_synced_at":"2025-03-18T17:14:11.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Scifabric/pybossa","license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidmerfield.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-04-08T20:25:02.000Z","updated_at":"2025-03-14T06:57:18.000Z","dependencies_parsed_at":"2023-02-17T06:00:51.579Z","dependency_job_id":"6e62133e-e048-4ca5-9381-ef0c529fc9ce","html_url":"https://github.com/davidmerfield/randomColor","commit_stats":{"total_commits":267,"total_committers":33,"mean_commits":8.090909090909092,"dds":"0.18726591760299627","last_synced_commit":"a045a83a2ee0de85ed5448b938ff4d6ef18a397e"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmerfield%2FrandomColor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmerfield%2FrandomColor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmerfield%2FrandomColor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmerfield%2FrandomColor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidmerfield","download_url":"https://codeload.github.com/davidmerfield/randomColor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244565525,"owners_count":20473284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:08.806Z","updated_at":"2025-03-20T06:31:28.586Z","avatar_url":"https://github.com/davidmerfield.png","language":"JavaScript","readme":"# [Random Color](https://randomcolor.lllllllllllllllll.com)\n\nA tiny script for generating attractive random colors. See the demo for [an explanation](https://randomcolor.lllllllllllllllll.com) and [some samples](https://randomcolor.lllllllllllllllll.com). randomColor has been ported to [C#](https://github.com/nathanpjones/randomColorSharped), [C++](https://github.com/xuboying/randomcolor-cpp), [Go](https://github.com/hansrodtang/randomcolor), [Haskell](http://hackage.haskell.org/package/palette-0.3/docs/Data-Colour-Palette-RandomColor.html), [Kotlin](https://github.com/brian-norman/RandomKolor), [Mathematica](https://github.com/yuluyan/PrettyRandomColor), [PHP](https://github.com/mistic100/RandomColor.php), [Python](https://github.com/kevinwuhoo/randomcolor-py), [Raku](https://github.com/Xliff/p6-RandomColor), [Objective-C](https://github.com/yageek/randomColor), [Java](https://github.com/lzyzsd/AndroidRandomColor), [R](https://github.com/ronammar/randomcoloR), [Reason](https://github.com/ktrzos/bs-randomColor), [Dart](https://github.com/DAMMAK/RandomColorDart), [Ruby](https://github.com/khash/random_color), [Rust](https://github.com/elementh/random_color), [Swift](https://github.com/onevcat/RandomColorSwift) and [Typescript](https://www.npmjs.com/package/@types/randomcolor).\n\n[![Demo](http://i.imgur.com/lOLCqvu.gif)](https://randomcolor.lllllllllllllllll.com)\n\nTo use randomColor **in the browser**, download the [latest minified version of randomColor](http://cdnjs.com/libraries/randomcolor) and include it on your page. Then call the script:\n\n```javascript\nvar color = randomColor(); // a hex code for an attractive color\n```\n\nTo use randomColor **on the server with node.js**, install [randomColor from npm](https://www.npmjs.org/package/randomcolor) then call the script:\n\n```bash\nnpm install randomcolor\n```\n```javascript\nvar randomColor = require('randomcolor'); // import the script\nvar color = randomColor(); // a hex code for an attractive color\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```, ```green```, ```blue```, ```purple```, ```pink``` and ```monochrome``` are currently supported. If you pass a  hexidecimal color string such as ```#00FFFF```, randomColor will extract its hue value and use that to generate colors.\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``` (default).\n\n```alpha``` – A decimal between 0 and 1. Only relevant when using a format with an alpha channel (```rgba``` and ```hsla```). Defaults to a random value.\n\n## Examples\n\n```javascript\n\n// Returns a hex code for an attractive color\nrandomColor(); \n\n// Returns an array of ten green colors\nrandomColor({\n   count: 10,\n   hue: 'green'\n});\n\n// Returns a hex code for a light blue\nrandomColor({\n   luminosity: 'light',\n   hue: 'blue'\n});\n\n// Returns a hex code for a 'truly random' color\nrandomColor({\n   luminosity: 'random',\n   hue: 'random'\n});\n\n// Returns a bright color in RGB\nrandomColor({\n   luminosity: 'bright',\n   format: 'rgb' // e.g. 'rgb(225,200,20)'\n});\n\n// Returns a dark RGB color with random alpha\nrandomColor({\n   luminosity: 'dark',\n   format: 'rgba' // e.g. 'rgba(9, 1, 107, 0.6482447960879654)'\n});\n\n// Returns a dark RGB color with specified alpha\nrandomColor({\n   luminosity: 'dark',\n   format: 'rgba',\n   alpha: 0.5 // e.g. 'rgba(9, 1, 107, 0.5)',\n});\n\n// Returns a light HSL color with random alpha\nrandomColor({\n   luminosity: 'light',\n   format: 'hsla' // e.g. 'hsla(27, 88.99%, 81.83%, 0.6450211517512798)'\n});\n\n```\n\n","funding_links":[],"categories":["JavaScript","Built With","Repository","HTML","Color","🔧 Utilities \u0026 Miscellaneous","Color [🔝](#readme)","颜色","Colors"],"sub_categories":["Installing","Color","Runner","运行器","Reactive Programming","运行器e2e测试"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidmerfield%2FrandomColor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidmerfield%2FrandomColor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidmerfield%2FrandomColor/lists"}