{"id":37902393,"url":"https://github.com/loadingio/ldcolor","last_synced_at":"2026-01-16T17:05:41.558Z","repository":{"id":40294141,"uuid":"160658200","full_name":"loadingio/ldcolor","owner":"loadingio","description":"lightweight JS color library, adopted from d3-color.","archived":false,"fork":false,"pushed_at":"2025-09-17T03:46:34.000Z","size":498,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T04:45:25.925Z","etag":null,"topics":["color","hcl","hex","hsl","lab","rgb"],"latest_commit_sha":null,"homepage":"","language":"LiveScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loadingio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-12-06T10:25:16.000Z","updated_at":"2025-09-17T03:45:52.000Z","dependencies_parsed_at":"2024-06-21T16:52:57.196Z","dependency_job_id":"5bb05d85-202f-4436-9887-fc90867dabab","html_url":"https://github.com/loadingio/ldcolor","commit_stats":{"total_commits":40,"total_committers":1,"mean_commits":40.0,"dds":0.0,"last_synced_commit":"337dfe3aaa06ca900b6681b9cb5e9d13340f1fd9"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/loadingio/ldcolor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Fldcolor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Fldcolor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Fldcolor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Fldcolor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loadingio","download_url":"https://codeload.github.com/loadingio/ldcolor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Fldcolor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"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","hcl","hex","hsl","lab","rgb"],"created_at":"2026-01-16T17:05:37.316Z","updated_at":"2026-01-16T17:05:41.552Z","avatar_url":"https://github.com/loadingio.png","language":"LiveScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ldcolor\n\nlightweight JS color library, adopted from d3-color.\n\n\n## USAGE\n\nconstruct a color object from some input, such as \"#f00\", \"rgba(0,255,128,1)\":\n\n```\n    color = new ldcolor(some-color-object-or-string);\n```\n\nthe result color will be in either RGBA or HSLA. Or, convert to the target format directly:\n\n```\n    ldcolor.hex(0xff9922);\n    ldcolor.hcl(\"#f92\");\n    color = new ldcolor(\"hsl(50%,50%,50%)\");\n    rgb = color.rgb();\n```\n\n\n## Spec\n\nldcolor is an object with following fields:\n\n * color space specific fields:\n   * RGB\n     * r: Red component, for RGB.\n     * g: Green component, for RGB.\n     * b: Blue component, for RGB.\n   * HCL / HSL\n     * h: Hue component, for HSL/HCL.\n     * s: Saturation component, for HSL.\n     * c: Chroma component, for HCL.\n     * l: Red component, for HSL/HCL.\n   * LAB\n     * @l: L(Lightness) component, for LAB\n     * @a: A\\*(Green-Red) component, for LAB\n     * @b: B\\*(Blue-Yellow) component, for LAB.\n   * Generic\n     * a: Alpha component, if applicable.\n     * hex: hex code for this color, if exists.\n     * value: web color value for this color. deprecated.\n     * offset: between 0 ~ 1, position if visualized. Also work as offset in gradient.\n     * mean: purpose for this color in a palette, if applicable.\n   * Application Defined\n     TBD.\n\nldcolor.js wont't write into offset, hex and mean fields.\n\n## API\n\nldcolor provides following API:\n\n - `same(color1, color2)` - check if `color1` equals to `color2`.\n   - colors are checked after converted to integer RGB with alpha channel to 3 decimal points,\n     to prevent inconsistency between conversion of hex, hsl and other formats.\n - `rgb(color)` - convert `color` to RGB space ( range: 0 ~ 255 ).\n - `rgbfv(color)` - convert `color` to RGB space ( range: 0 ~ 1 ).\n - `web(color)` - convert `color` to web friendly string.\n - `hex(color,compact)` - convert `color` to hex string. use `#fff` format when possible if `compact` is true.\n - `rgbaStr(color)` - convert `color` to rgba string.\n - `hsl(color)` - convert `color` to HSL space\n - `hcl(color)` - convert `color` to HCL space\n - `lab(color)` - convert `color` to LAB space\n - `int(color)` - convert `color` to 24bit integer.\n - `rand()` - randomize and return a color\n - `lighter(color, strength)` - make `color` lighter\n - `darker(color, strength)` - make `color` darker\n - `complement(color)` - get complementary of `color`\n\nThese API are also available as a member function in a `ldcolor` object:\n\n    (new ldcolor('#fff')).darker!\n\n\n## Boundary Condition\n\n - there is no RGB information in `transparent` string, thus it will return `rgba(NaN,NaN,NaN,0)`.\n - colors with NaN or semi-transparent colors can't be converted to hex code. Thus, in order to use them safely, use `ldcolor.web` instead of `ldcolor.hex` to convert colors if transparency is needed.\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floadingio%2Fldcolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floadingio%2Fldcolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floadingio%2Fldcolor/lists"}