{"id":13514203,"url":"https://github.com/cheatsnake/xColors-api","last_synced_at":"2025-03-31T02:33:35.174Z","repository":{"id":42185317,"uuid":"427731786","full_name":"cheatsnake/xColors-api","owner":"cheatsnake","description":"🌈 HTTP API for generating \u0026 converting colors.","archived":false,"fork":false,"pushed_at":"2022-11-23T15:42:39.000Z","size":65,"stargazers_count":34,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-01T17:39:47.696Z","etag":null,"topics":["api","colors","converter","express","free","herokuapp","hex","hsl","nodejs","random","rgb","ts-node","typescript"],"latest_commit_sha":null,"homepage":"https://x-colors.yurace.pro","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cheatsnake.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-13T17:38:06.000Z","updated_at":"2024-09-29T02:01:51.000Z","dependencies_parsed_at":"2022-08-12T08:50:35.601Z","dependency_job_id":null,"html_url":"https://github.com/cheatsnake/xColors-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheatsnake%2FxColors-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheatsnake%2FxColors-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheatsnake%2FxColors-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheatsnake%2FxColors-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheatsnake","download_url":"https://codeload.github.com/cheatsnake/xColors-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246407403,"owners_count":20772127,"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":["api","colors","converter","express","free","herokuapp","hex","hsl","nodejs","random","rgb","ts-node","typescript"],"created_at":"2024-08-01T05:00:49.527Z","updated_at":"2025-03-31T02:33:30.166Z","avatar_url":"https://github.com/cheatsnake.png","language":"TypeScript","funding_links":[],"categories":["Index"],"sub_categories":["Art \u0026 Design"],"readme":"[![Website](https://img.shields.io/website?down_color=orange\u0026down_message=xColors%20API\u0026up_color=orange\u0026up_message=xColors%20API\u0026url=https%3A%2F%2Fx-colors.yurace.pro%2F)](https://x-colors.yurace.pro/)\n![GitHub repo size](https://img.shields.io/github/repo-size/cheatsnake/xColors-api?color=a349f7)\n![GitHub](https://img.shields.io/github/license/cheatsnake/xColors-api?color=%235DAF83)\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/cheatsnake/xColors-api/issues)\n\n# :rainbow: xColors API\n\nA free API for generate \u0026amp; convert colors.\n\n## :eyeglasses: Overview\n\nxColors is a completely free service that provides the ability to get random colors and convert them into various color models (HEX, RGB and HSL are supported). All data comes in a convenient JSON format, so you can immediately use them for styling in CSS without additional validation.\n\n## :page_facing_up: API Documentation\n\n### :game_die: Get random color\n\nGet a JSON object that contains a random color in three HEX, RGB and HSL color models at once.\n\n```sh\nhttps://x-colors.yurace.pro/api/random\n```\n\n```sh\n{\n    hex: \"#CCFB7B\",\n    rgb: \"rgb(204, 251, 123)\",\n    hsl: \"hsl(82, 51%, 98%)\"\n}\n```\n\n### :art: Get random color with a given hue\n\nYou can get random shades of the color you need. For example, using reserved names such as:\n\u003cbr\u003e\n\u003ci\u003e[ red, pink, puprle, navy, blue, aqua, green, lime, yellow, orange ]\u003c/i\u003e\n\u003cbr\u003e\n\n```sh\nhttps://x-colors.yurace.pro/api/random/blue\n```\n\nInstead of reserved words, you can use any number from the range [0, 359] - which corresponds to the [HUE scale](https://en.wikipedia.org/wiki/Hue).\n\n```sh\nhttps://x-colors.yurace.pro/api/random/228\n```\n\n### :wrench: Parameters\n\nThe \u003ci\u003enumber\u003c/i\u003e parameter allows you to get an array containing the desired number of random colors.\n\n```sh\n?number=3\n```\n\nThe \u003ci\u003etype\u003c/i\u003e parameter allows you to get either only a dark or light shade of color. This allows you to know in advance what font color to use against the background of the resulting color. Usually, the font color is white on dark colors, and black on light colors.\n\n\u003e It works if you have specified the \u003cb\u003e{hue}/{color}\u003c/b\u003e you need or use \u003cb\u003eall\u003c/b\u003e - for an any color.\n\n```sh\n/random/{hue/color/all}?type=dark\n```\n\n```sh\n/random/{hue/color/all}?type=light\n```\n\n### :arrows_counterclockwise: Converting сolors\n\nYou can freely convert colors between three color models. To do this, use the desired endpoint and use the \u003ci\u003evalue\u003c/i\u003e parameter to specify the color value of the color model, depending on the selected endpoint.\n\u003cbr\u003e\u003cbr\u003e\nConvert HEX to RGB\n\n```sh\nhttps://x-colors.yurace.pro/api/hex2rgb?value=FFFFFF\n```\n\nConvert HEX to HSL\n\n```sh\nhttps://x-colors.yurace.pro/api/hex2hsl?value=FFFFFF\n```\n\nConvert RGB to HEX\n\n```sh\nhttps://x-colors.yurace.pro/api/rgb2hex?value=120-200-30\n```\n\nConvert RGB to HSL\n\n```sh\nhttps://x-colors.yurace.pro/api/rgb2hsl?value=120-200-30\n```\n\nConvert HSL to HEX\n\n```sh\nhttps://x-colors.yurace.pro/api/hsl2hex?value=300-90-50\n```\n\nConvert HSL to RGB\n\n```sh\nhttps://x-colors.yurace.pro/api/hsl2rgb?value=300-90-50\n```\n\n## :dart: Examples\n\n```sh\nhttps://x-colors.yurace.pro/api/random?number=10\n```\n\n```sh\nhttps://x-colors.yurace.pro/api/random/green?number=10\u0026type=light\n```\n\n```sh\nhttps://x-colors.yurace.pro/api/random/123?type=dark\u0026number=2\n```\n\n```sh\nhttps://x-colors.yurace.pro/api/hsl2hex/?value=hsl(200,20,10)\n```\n\n```sh\nhttps://x-colors.yurace.pro/api/hex2rgb/?value=e2A4bF\n```\n\n## :zap: Available Scripts\n\nIn the project directory, you can:\n\n-   Run the server with Nodemon for development\n\n```sh\nnpm run dev\n```\n\n\u003e The page will reload if you make edits.\\\n\u003e You will also see any lint errors in the console.\\\n\u003e Open [http://localhost:5000](http://localhost:5000) to view it in the browser.\n\n-   Launch tests\n\n```sh\nnpm run test\n```\n\n-   Create a production build\n\n```sh\nnpm run build\n```\n\n-   Runs the server of production build\n\n```sh\nnpm start\n```\n\n\u003e Open [http://localhost:5000](http://localhost:5000) to view it in the browser.\n\n## :whale: Docker startup\n\n1. Build docker image from Dockerfile:\n\n```\ndocker build . -t xcolors\n```\n\n2. Create docker container from new image:\n\n```\ndocker run -p 5000:5000 -d --name xcolors-server xcolors\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheatsnake%2FxColors-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheatsnake%2FxColors-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheatsnake%2FxColors-api/lists"}