{"id":21917324,"url":"https://github.com/blukai/abcolor","last_synced_at":"2026-05-10T19:41:16.599Z","repository":{"id":57171927,"uuid":"81233268","full_name":"blukai/abcolor","owner":"blukai","description":"🎨 Color conversion \u0026 tool, that helps to visualize..","archived":false,"fork":false,"pushed_at":"2017-03-07T00:08:14.000Z","size":59,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T18:12:39.863Z","etag":null,"topics":["background","color","conversion","css","data-visualization","gradient","hex","hsl","percent","rgb","visualization"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/blukai.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}},"created_at":"2017-02-07T17:11:24.000Z","updated_at":"2022-02-24T00:52:33.000Z","dependencies_parsed_at":"2022-08-24T13:30:51.287Z","dependency_job_id":null,"html_url":"https://github.com/blukai/abcolor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blukai%2Fabcolor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blukai%2Fabcolor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blukai%2Fabcolor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blukai%2Fabcolor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blukai","download_url":"https://codeload.github.com/blukai/abcolor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244937740,"owners_count":20535124,"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":["background","color","conversion","css","data-visualization","gradient","hex","hsl","percent","rgb","visualization"],"created_at":"2024-11-28T19:30:09.846Z","updated_at":"2026-05-10T19:41:11.547Z","avatar_url":"https://github.com/blukai.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![abcolor](header.png)\n[![Build Status](https://travis-ci.org/blukai/abcolor.svg?branch=master)](https://travis-ci.org/blukai/abcolor)\n\n🎨 Color conversion and tool, that helps to visualize some data.\n\nLooking for example to use abcolor? Head over to [opendota.com](https://www.opendota.com/heroes).\n\n## Installation\n\n`npm install --save abcolor`\n\n## Usage\n### Gradient\nBut actually, not quite gradient\n```js\nimport { gradient } from 'abcolor';\n\ngradient(89, {\n  model: 'rgb',\n  from: '5fe4bd',\n  to: 'fbc939',\n  css: true\n});\n// Result: rgb(234,204,72)\n```\n  - **`percent`**- Required, numeric[*](#numeric---string-number--number)\n  - **`options`**- Optional, object\n    - `model:` String, can be `rgb` or `hsl`. `Hsl` by default\n    - `from:` String / numeric[*](#numeric---string-number--number) / array (RGB), 0% color. [`Red`](http://www.colorhexa.com/ff0000) by default\n    - `to:` String / numeric[*](#numeric---string-number--number) / array (RGB), 100% color. [`Green`](http://www.colorhexa.com/00ff00) by default\n    - `css:` Boolean, `False` by default\n\n### Conversions\n#### Hex to RGB\n```js\nimport { hexToRgb } from 'abcolor';\n\nhexToRgb('#94f');\n// Result: array of RGB values - [153, 68, 255]\n\nhexToRgb('#94f', true);\n// Result: array of RGB Percent values - [60, 26.67, 100]\n\nhexToRgb('#94f', null, true);\n// Result: rgb(153,68,255)\n```\n  - **`hexadecimal`**- Required, string / number. Six-digit (9000f0) or three-digit (94f) Hex triplet. It can begins from hash char (#), or not\n  - **`percent`**- Optional, boolean, `False` by default\n  - **`css`**- Optional, boolean, `False` by default\n\n#### Hex to HSL\n```js\nimport { hexToHsl } from 'abcolor';\n\nhexToHsl('00a1f1')\n// Result: array of HSL values - [199.92, 100, 47.25]\n\nhexToHsl('00a1f1', true)\n// Result: hsl(199.92,100%,47.25%)\n```\n  - **`hexadecimal`**- Required, string / number. Six-digit (9000f0) or three-digit (94f) Hex triplet. It can begins from hash char (#), or not.\n  - **`css`**- Optional, boolean, `False` by default\n\n#### RGB to HSL\n```js\nimport { rgbToHsl } from 'abcolor';\n\nrgbToHsl([153, 68, 255]);\n// Result: array of HSL values - [267.27, 100, 63.33]\n\nrgbToHsl([153, 68, 255], true);\n// Result: hsl(267.27,100%,63.33%)\n```\n  - **`rgb`**- Required, array. Array of RGB values (0 - 255 range)\n  - **`css`**- Optional, boolean, `False` by default\n\n###### [Numeric](https://github.com/blukai/abcolor/blob/master/src/utility/index.js#L1)* - string-number / number\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblukai%2Fabcolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblukai%2Fabcolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblukai%2Fabcolor/lists"}