{"id":15760443,"url":"https://github.com/d3/d3-hsv","last_synced_at":"2025-09-11T06:34:42.093Z","repository":{"id":65976703,"uuid":"60735937","full_name":"d3/d3-hsv","owner":"d3","description":"The HSV (Hue, Saturation, Value) color space.","archived":false,"fork":false,"pushed_at":"2020-07-10T15:03:16.000Z","size":20,"stargazers_count":27,"open_issues_count":1,"forks_count":10,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-30T15:25:55.559Z","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-06-08T22:49:19.000Z","updated_at":"2024-02-23T23:41:39.000Z","dependencies_parsed_at":"2023-02-19T19:01:16.164Z","dependency_job_id":null,"html_url":"https://github.com/d3/d3-hsv","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3%2Fd3-hsv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3%2Fd3-hsv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3%2Fd3-hsv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3%2Fd3-hsv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d3","download_url":"https://codeload.github.com/d3/d3-hsv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237267991,"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:01.039Z","updated_at":"2025-02-05T08:31:12.986Z","avatar_url":"https://github.com/d3.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# d3-hsv\n\nThis module implements the [HSV](https://en.wikipedia.org/wiki/HSL_and_HSV) (Hue, Saturation, Value) color space.\n\nFor example, to recreate R’s terrain.colors:\n\n```js\nvar i0 = d3.interpolateHsvLong(d3.hsv(120, 1, 0.65), d3.hsv(60, 1, 0.90)),\n    i1 = d3.interpolateHsvLong(d3.hsv(60, 1, 0.90), d3.hsv(0, 0, 0.95));\n\nfunction interpolateTerrain(t) {\n  return t \u003c 0.5 ? i0(t * 2) : i1((t - 0.5) * 2);\n}\n```\n\n## Installing\n\nIf you use NPM, `npm install d3-hsv`. Otherwise, download the [latest release](https://github.com/d3/d3-hsv/releases/latest). You can also load directly from [d3js.org](https://d3js.org) as a [standalone library](https://d3js.org/d3-hsv.v0.1.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://d3js.org/d3-hsv.v0.1.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n\nvar yellow = d3.hsv(\"yellow\"); // {h: 60, s: 1, v: 1, opacity: 1}\n\n\u003c/script\u003e\n```\n\n[Try d3-hsv in your browser.](https://tonicdev.com/npm/d3-hsv)\n\n## API Reference\n\n\u003ca name=\"hsv\" href=\"#hsv\"\u003e#\u003c/a\u003e d3.\u003cb\u003ehsv\u003c/b\u003e(\u003ci\u003eh\u003c/i\u003e, \u003ci\u003es\u003c/i\u003e, \u003ci\u003ev\u003c/i\u003e[, \u003ci\u003eopacity\u003c/i\u003e]) [\u003c\u003e](https://github.com/d3/d3-hsv/blob/master/src/hsv.js \"Source\")\u003cbr\u003e\n\u003ca href=\"#hsv\"\u003e#\u003c/a\u003e d3.\u003cb\u003ehsv\u003c/b\u003e(\u003ci\u003especifier\u003c/i\u003e)\u003cbr\u003e\n\u003ca href=\"#hsv\"\u003e#\u003c/a\u003e d3.\u003cb\u003ehsv\u003c/b\u003e(\u003ci\u003ecolor\u003c/i\u003e)\u003cbr\u003e\n\nConstructs a new [HSV](https://en.wikipedia.org/wiki/HSL_and_HSV) color. The channel values are exposed as `h`, `s` and `v` properties on the returned instance.\n\nIf *h*, *s* and *v* 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 HSV 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 HSV.\n\n\u003ca href=\"#interpolateHsv\"\u003e#\u003c/a\u003e d3.\u003cb\u003einterpolateHsv\u003c/b\u003e(\u003ci\u003ea\u003c/i\u003e, \u003ci\u003eb\u003c/i\u003e) [\u003c\u003e](https://github.com/d3/d3-hsv/blob/master/src/interpolateHsv.js \"Source\")\u003cbr\u003e\n\nReturns an HSV color space interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in HSV; they will be converted to HSV using [d3.hsv](#hsv). If either color’s hue or chroma is NaN, the opposing color’s channel value is used. The shortest path between hues is used. The return value of the interpolator is an RGB string.\n\n\u003ca href=\"#interpolateHsvLong\"\u003e#\u003c/a\u003e d3.\u003cb\u003einterpolateHsvLong\u003c/b\u003e(\u003ci\u003ea\u003c/i\u003e, \u003ci\u003eb\u003c/i\u003e) [\u003c\u003e](https://github.com/d3/d3-hsv/blob/master/src/interpolateHsv.js \"Source\")\u003cbr\u003e\n\nLike [interpolateHsv](#interpolateHsv), but does not use the shortest path between hues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd3%2Fd3-hsv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd3%2Fd3-hsv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd3%2Fd3-hsv/lists"}