d3-hsv
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/d3-hsv package

0.1.0 • Public • Published

d3-hsv

This module implements the HSV (Hue, Saturation, Value) color space.

Installing

If you use NPM, npm install d3-hsv. Otherwise, download the latest release. You can also load directly from d3js.org as a standalone library. AMD, CommonJS, and vanilla environments are supported. In vanilla, a d3 global is exported:

<script src="https://d3js.org/d3-color.v0.5.min.js"></script>
<script src="https://d3js.org/d3-hsv.v0.0.min.js"></script>
<script>
 
var yellow = d3.hsv("yellow"); // {h: 60, s: 1, v: 1, opacity: 1}
 
</script> 

Try d3-hsv in your browser.

API Reference

# d3.hsv(h, s, v[, opacity])
# d3.hsv(specifier)
# d3.hsv(color)

Constructs a new HSV color. The channel values are exposed as h, s and v properties on the returned instance.

If 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 for examples. If a color instance is specified, it is converted to the RGB color space using color.rgb and then converted to HSV.

# d3.interpolateHsv(a, b)

# d3.interpolateHsvLong(a, b)

Readme

Keywords

Package Sidebar

Install

npm i d3-hsv

Weekly Downloads

2,242

Version

0.1.0

License

BSD-3-Clause

Last publish

Collaborators

  • mbostock