{"id":15760441,"url":"https://github.com/d3/d3-hcg","last_synced_at":"2025-10-20T04:31:55.959Z","repository":{"id":43466224,"uuid":"62412875","full_name":"d3/d3-hcg","owner":"d3","description":"The HCG (Hue, Chroma, Grayness) color space derived from the Munsell color system. ","archived":false,"fork":false,"pushed_at":"2019-11-02T08:23:44.000Z","size":14,"stargazers_count":21,"open_issues_count":3,"forks_count":9,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-01-30T15:25:22.696Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/d3.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":"2016-07-01T18:37:07.000Z","updated_at":"2024-10-14T06:07:26.000Z","dependencies_parsed_at":"2022-09-21T01:40:54.865Z","dependency_job_id":null,"html_url":"https://github.com/d3/d3-hcg","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3%2Fd3-hcg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3%2Fd3-hcg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3%2Fd3-hcg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3%2Fd3-hcg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d3","download_url":"https://codeload.github.com/d3/d3-hcg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237267990,"owners_count":19282326,"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-10-04T10:58:00.734Z","updated_at":"2025-10-20T04:31:50.687Z","avatar_url":"https://github.com/d3.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# d3-hcg\n\nThis module implements the [HCG](https://github.com/acterhd/hcg-color) (Hue, Chroma, Grayness) color space.\n\n## Installing\n\nIf you use NPM, `npm install d3-hcg`. Otherwise, download the [latest release](https://github.com/d3/d3-hcg/releases/latest). You can also load directly from [d3js.org](https://d3js.org) as a [standalone library](https://d3js.org/d3-hcg.v0.0.min.js). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:\n\n```html\n\u003cscript src=\"https://d3js.org/d3-color.v1.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://unpkg.com/d3-hcg@0.0\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n\nvar yellow = d3.hcg(\"yellow\"); // {h: 60, c: 1, g: 0, opacity: 1}\n\n\u003c/script\u003e\n```\n\n[Try d3-hcg in your browser.](https://tonicdev.com/npm/d3-hcg)\n\n## API Reference\n\n\u003ca name=\"hcg\" href=\"#hcg\"\u003e#\u003c/a\u003e d3.\u003cb\u003ehcg\u003c/b\u003e(\u003ci\u003eh\u003c/i\u003e, \u003ci\u003ec\u003c/i\u003e, \u003ci\u003eg\u003c/i\u003e[, \u003ci\u003eopacity\u003c/i\u003e])\u003cbr\u003e\n\u003ca href=\"#hcg\"\u003e#\u003c/a\u003e d3.\u003cb\u003ehcg\u003c/b\u003e(\u003ci\u003especifier\u003c/i\u003e)\u003cbr\u003e\n\u003ca href=\"#hcg\"\u003e#\u003c/a\u003e d3.\u003cb\u003ehcg\u003c/b\u003e(\u003ci\u003ecolor\u003c/i\u003e)\u003cbr\u003e\n\nConstructs a new HCG color. The channel values are exposed as `h`, `c` and `g` properties on the returned instance.\n\nIf *h*, *c* and *g* are specified, these represent the channel values of the returned color; an *opacity* may also be specified. If a CSS Color Module Level 3 *specifier* string is specified, it is parsed and then converted to the HCG color space. See [d3.color](https://github.com/d3/d3-color#color) for examples. If a [*color*](https://github.com/d3/d3-color#color) instance is specified, it is converted to the RGB color space using [*color*.rgb](https://github.com/d3/d3-color#color_rgb) and then converted to HCG.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd3%2Fd3-hcg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd3%2Fd3-hcg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd3%2Fd3-hcg/lists"}