{"id":19846462,"url":"https://github.com/kostad02/color-utils","last_synced_at":"2026-04-06T21:31:44.907Z","repository":{"id":226903110,"uuid":"769944913","full_name":"KostaD02/Color-Utils","owner":"KostaD02","description":"Lightweight TypeScript library for working with colors","archived":false,"fork":false,"pushed_at":"2024-03-10T15:42:39.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-20T00:34:22.149Z","etag":null,"topics":["color","color-utils","colors","js","lib","library","ts"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@kostad/color-utils","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/KostaD02.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-10T14:01:15.000Z","updated_at":"2024-11-16T14:43:55.000Z","dependencies_parsed_at":"2024-11-12T13:11:39.044Z","dependency_job_id":"fee9c057-d333-4067-a714-1aea0865c221","html_url":"https://github.com/KostaD02/Color-Utils","commit_stats":null,"previous_names":["kostad02/color-utils","kostad02/color-kit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KostaD02/Color-Utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KostaD02%2FColor-Utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KostaD02%2FColor-Utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KostaD02%2FColor-Utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KostaD02%2FColor-Utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KostaD02","download_url":"https://codeload.github.com/KostaD02/Color-Utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KostaD02%2FColor-Utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31491096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"ssl_error","status_checked_at":"2026-04-06T17:22:54.741Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["color","color-utils","colors","js","lib","library","ts"],"created_at":"2024-11-12T13:11:35.942Z","updated_at":"2026-04-06T21:31:44.879Z","avatar_url":"https://github.com/KostaD02.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Color Utils\n\nColor-utils is a lightweight TypeScript library for working with colors in web development projects. It provides convenient methods for converting between different color formats, generating random colors, and more.\n\n## Installation\n\nYou can install color-uit via npm:\n\n```bash\nnpm i @kostad/color-utils\n```\n\n## Usage\n\nThis library is compatible with both JavaScript and TypeScript projects, allowing seamless integration into a wide range of web development environments.\n\nFor JavaScript:\n\n```js\nconst { getRandomHex, getRandomRgb } = require(\"@kostad/color-utils\");\n\nconsole.log(getRandomHex()); // #b68e0a\nconsole.log(getRandomRgb()); // rgb(104,95,95)\n```\n\nFor Typescript\n\n```ts\nimport { getRandomHex, getRandomRgb } from \"@kostad/color-utils\";\n\nconsole.log(getRandomHex()); // #867220\nconsole.log(getRandomRgb()); // rgb(59,135,164)\n```\n\n## API\n\nThe library provides a variety of methods for working with RGB and hexadecimal color formats. In the future, additional functionalities such as HSL support will be added.\n\n### RGB\n\n| Method          | Params | Description                                                                                                                                                                                                                                            | Return           |\n| --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- |\n| `getRandomRgb`  | None   | The function will return random RGB color                                                                                                                                                                                                              | `rgb`            |\n| `getRandomRgba` | None   | The function will return random RGBA color                                                                                                                                                                                                             | `rgba`           |\n| `rgbToHex`      | `rgb`  | The function will accept an RGB string in plain text format (`'rgb(r,g,b)'`). It will attempt to convert it to hexadecimal. If conversion is successful, it will return the hexadecimal value. If conversion is not possible, it will return null.     | `hex` or `null`  |\n| `rgbaToHexa`    | `rgba` | The function will accept an RGBA string in plain text format (`'rgba(r,g,b,a)'`). It will attempt to convert it to hexadecimal. If conversion is successful, it will return the hexadecimal value. If conversion is not possible, it will return null. | `hexa` or `null` |\n\n### HEX\n\n| Method          | Params | Description                                                                                                                                                                                                                          | Return           |\n| --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- |\n| `getRandomHex`  | None   | The function will return random HEX color                                                                                                                                                                                            | `hex`            |\n| `getRandomHexa` | None   | The function will return random HEXA color                                                                                                                                                                                           | `hexa`           |\n| `hexToRgb`      | `hex`  | The function will accept a hexadecimal string (`#rrggbb`) as input. It will attempt to convert it to an RGB format. If conversion is successful, it will return the RGB value. If conversion is not possible, it will return null.   | `rgb` or `null`  |\n| `hexaToRgba`    | `hexa` | The function will accept a hexadecimal string (`#rrggbbaa`) as input. It will attempt to convert it to an RGB format. If conversion is successful, it will return the RGB value. If conversion is not possible, it will return null. | `rgba` or `null` |\n\n## License\n\nColor Utils is [MIT licensed](https://github.com/KostaD02/color-utils/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkostad02%2Fcolor-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkostad02%2Fcolor-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkostad02%2Fcolor-utils/lists"}